Date: Mon, 8 Jan 2001 09:45:23 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: "Mark E." cc: djgpp-workers AT delorie DOT com Subject: Re: valloc and memalign draft In-Reply-To: <3A5906C0.4802.38ACFF@localhost> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 8 Jan 2001, Mark E. wrote: > > > + /* Temporarily clear chunk-in-use bit so macros work correctly. */ > > > + b1->size &= ~1; > > > > Isn't this a bit dangerous? Doesn't it leave the malloc chain in an > > inconsistent state, for a small window of opportunities? What if some > > signal (i.e. exception) strikes between this line and where you restore > > the bit, and the code run from the signal handler calls memalign? > > I hadn't thought of that. Would adding '& ~1' to BEFSZ, ENDSZ, etc. work for > you? I think it's better.