From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87506 invoked by alias); 31 Oct 2019 03:08:54 -0000 Mailing-List: contact glibc-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: glibc-cvs-owner@sourceware.org List-Subscribe: Received: (qmail 87450 invoked by uid 97); 31 Oct 2019 03:08:54 -0000 Date: Thu, 31 Oct 2019 03:08:00 -0000 Message-ID: <20191031030854.87448.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: DJ Delorie To: glibc-cvs@sourceware.org Subject: [glibc] Base max_fast on alignment, not width, of bins (Bug 24903) X-Act-Checkin: glibc X-Git-Author: DJ Delorie X-Git-Refname: refs/heads/master X-Git-Oldrev: 62193c4a3af9c1e15c039b323f45ccd2fddc119f X-Git-Newrev: ff12e0fb91b9072800f031cb21fb2651ee7b6251 X-SW-Source: 2019-q4/txt/msg00213.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ff12e0fb91b9072800f031cb21fb2651ee7b6251 commit ff12e0fb91b9072800f031cb21fb2651ee7b6251 Author: DJ Delorie Date: Wed Oct 30 18:03:14 2019 -0400 Base max_fast on alignment, not width, of bins (Bug 24903) set_max_fast sets the "impossibly small" value based on, eventually, MALLOC_ALIGNMENT. The comparisons for the smallest chunk used is, eventually, MIN_CHUNK_SIZE. Note that i386 is the only platform where these are the same, so a smallest chunk *would* be put in a no-fastbins fastbin. This change calculates the "impossibly small" value based on MIN_CHUNK_SIZE instead, so that we can know it will always be impossibly small. Diff: --- malloc/malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/malloc/malloc.c b/malloc/malloc.c index 5d3e82a..70cc35a 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -1621,7 +1621,7 @@ static INTERNAL_SIZE_T global_max_fast; #define set_max_fast(s) \ global_max_fast = (((s) == 0) \ - ? SMALLBIN_WIDTH : ((s + SIZE_SZ) & ~MALLOC_ALIGN_MASK)) + ? MIN_CHUNK_SIZE / 2 : ((s + SIZE_SZ) & ~MALLOC_ALIGN_MASK)) static inline INTERNAL_SIZE_T get_max_fast (void)