From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/528 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: unneeded mremap calls in realloc Date: Thu, 17 Nov 2011 13:31:24 +0100 Message-ID: <20111117123124.GW24939@port70.net> References: <20111116004536.GV24939@port70.net> <20111117050253.GS132@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1321533102 30091 80.91.229.12 (17 Nov 2011 12:31:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 17 Nov 2011 12:31:42 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-529-gllmg-musl=m.gmane.org@lists.openwall.com Thu Nov 17 13:31:38 2011 Return-path: Envelope-to: gllmg-musl@lo.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1RR17y-0001xe-5O for gllmg-musl@lo.gmane.org; Thu, 17 Nov 2011 13:31:38 +0100 Original-Received: (qmail 15784 invoked by uid 550); 17 Nov 2011 12:31:36 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 15776 invoked from network); 17 Nov 2011 12:31:36 -0000 Content-Disposition: inline In-Reply-To: <20111117050253.GS132@brightrain.aerifal.cx> User-Agent: Mutt/1.5.20 (2009-06-14) Xref: news.gmane.org gmane.linux.lib.musl.general:528 Archived-At: * Rich Felker [2011-11-17 00:02:53 -0500]: > On Wed, Nov 16, 2011 at 01:45:37AM +0100, Szabolcs Nagy wrote: > > (there might be better fix, eg why oldlen is not a > > multiple of pagesize in the first place?) > > oldlen was computed in terms of CHUNK_SIZE macro, which was incorrect > for mmapped chunks (masking off too many bits). should be fixed now. > > Rich btw in realloc there is this comment: /* FIXME: find what's wrong here and reenable it..? */ if (0 && n > n1 && alloc_rev(self)) { self = PREV_CHUNK(self); n1 += CHUNK_SIZE(self); } can it be that the CHUNK_SIZE fix solves this as well?