From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82583 invoked by alias); 19 Nov 2019 12:12:38 -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 82491 invoked by uid 10174); 19 Nov 2019 12:12:31 -0000 Date: Tue, 19 Nov 2019 12:12:00 -0000 Message-ID: <20191119121231.82490.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Arjun Shankar To: glibc-cvs@sourceware.org Subject: [glibc/release/2.30/master] 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/release/2.30/master X-Git-Oldrev: 09abef31a59e6a524d1d4142ad4eb40ad0a41ccd X-Git-Newrev: 919af705eef416f4469341dfdf4ca23450f30236 X-SW-Source: 2019-q4/txt/msg00371.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=919af705eef416f4469341dfdf4ca23450f30236 commit 919af705eef416f4469341dfdf4ca23450f30236 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. (cherry picked from commit ff12e0fb91b9072800f031cb21fb2651ee7b6251) Diff: --- malloc/malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/malloc/malloc.c b/malloc/malloc.c index fe97377..8c68b21 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)