From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83601 invoked by alias); 18 Nov 2019 18:05:07 -0000 Mailing-List: contact libc-stable-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: List-Archive: Sender: libc-stable-owner@sourceware.org Received: (qmail 83571 invoked by uid 89); 18 Nov 2019 18:05:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1082 X-Spam-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: aloka.lostca.se Received: from aloka.lostca.se (HELO aloka.lostca.se) (178.63.46.202) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 Nov 2019 18:05:05 +0000 Received: from aloka.lostca.se (aloka [127.0.0.1]) by aloka.lostca.se (Postfix) with ESMTP id 9024515E82 for ; Mon, 18 Nov 2019 18:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lostca.se; h=date:from:to :subject:message-id:mime-version:content-type; s=howrah; bh=M/hZ Jbar7C1iAvZIAmOBwW4GKMs=; b=djBo2iRBJIinf7MK6zdUu1ZdnHWdu28NE04d YXTZoKfcu6SqO576GZsqtdC6fo9h5qS7PkhvEi5RqfTlZgz3ElojZUQ73Jj1itV3 HuFLHnC5/Ps/hFwnzIjHNPY1Lxfg2PX4o+eJqzttdMliNNMO0enDkTZ/T/PYBU05 0NLtqic= Received: from localhost (unknown [IPv6:2a01:4f8:120:624c::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aloka.lostca.se (Postfix) with ESMTPSA id 5953415E81 for ; Mon, 18 Nov 2019 18:05:03 +0000 (UTC) Date: Tue, 01 Jan 2019 00:00:00 -0000 From: Arjun Shankar To: libc-stable@sourceware.org Subject: [2.29 COMMITTED] Base max_fast on alignment, not width, of bins (Bug 24903) Message-ID: <20191118180502.GE73440@aloka.lostca.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes X-SW-Source: 2019-11/txt/msg00016.txt.bz2 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) --- malloc/malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/malloc/malloc.c b/malloc/malloc.c index ecdb2a0f36..9ce0941b9a 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -1635,7 +1635,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) -- 2.21.0