delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/01/08/02:47:03

Date: Mon, 8 Jan 2001 09:45:23 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "Mark E." <snowball3 AT bigfoot DOT com>
cc: djgpp-workers AT delorie DOT com
Subject: Re: valloc and memalign draft
In-Reply-To: <3A5906C0.4802.38ACFF@localhost>
Message-ID: <Pine.SUN.3.91.1010108094454.4690L-100000@is>
MIME-Version: 1.0
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

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019