From 186d734084affcdbf448110caccb9e51eb7ad4a3 Mon Sep 17 00:00:00 2001 From: dmiller Date: Mon, 19 Sep 2022 17:51:44 +0000 Subject: [PATCH] Don't bother aligning charpool allocs: not using for non-strings any more --- charpool.cc | 9 --------- 1 file changed, 9 deletions(-) diff --git a/charpool.cc b/charpool.cc index b0699d21d..15b554014 100644 --- a/charpool.cc +++ b/charpool.cc @@ -84,11 +84,6 @@ void cp_free(void) { return g_charpool.clear(); } -/* Allocated blocks are allocated to multiples of ALIGN_ON. This is the - definition used by the malloc in Glibc 2.7, which says that it "suffices for - nearly all current machines and C compilers." */ -#define ALIGN_ON (2 * sizeof(size_t)) - CharPool::CharPool(size_t init_sz) { assert(init_sz >= 256); /* Create our char pool */ @@ -110,10 +105,6 @@ const char *CharPool::dup(const char *src, int len) { len = strlen(src); int sz = len + 1; char *p = buckets.back() + nexti; - int modulus; - - if ((modulus = sz % ALIGN_ON)) - sz += ALIGN_ON - modulus; while (nexti + sz > currentbucketsz) { /* Doh! We've got to make room */