delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/04/26/13:03:30

From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <10304261643.AA21358@clio.rice.edu>
Subject: Re: 2.04 status page / 2.04 alpha 1 release schedule
To: djgpp-workers AT delorie DOT com
Date: Sat, 26 Apr 2003 11:43:35 -0500 (CDT)
In-Reply-To: <3EAA819F.628880E5@yahoo.com> from "CBFalconer" at Apr 26, 2003 08:54:55 AM
X-Mailer: ELM [version 2.5 PL2]
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

> > The default sbrk has some surprising behavior at times that I'm
> > much more worried about.  You can get address sequences like:
> > 
> > 00010000
> > fffd0000
> > 00020000
> > 00030000
> > fffe0000
> > (etc)
> > 
> > Depending on how windows is feeling that particular day.  I believe
> > you confirmed that nmalloc has no problems with randomly returned
> > addresses which may not be in increasing order.
> 
> IIRC I said I believed it didn't affect anything.  I have never
> seen that effect.  On rereading my code I still see no problem. 
> sbrk is only called in one place, in routine extendsbrk().

To test this (and it really should be tested) you need shared memory
(Windows 9x does this).  You write two programs.  One allocates
a block of memory then pauses (exits on user input).  You open a
window (or two, or three) and run this program.  The other program
continues to allocate memory with malloc (and display the addresses
returned), but pauses between allocation so you can do something
else in one of the other windows.  (In my case I made the single
test program - probably on a CD someplace - be able to do all of
the above in a single program).

Typically I would start two other programs.  Then start the third,
let it pause.  Go to first window let it exit/kill it.  Then allow
the third to allocate blocks of memory.  You will see addresses
which look like negative values.  If you allocate enough you get the
jump back to positive values.  Then kill the second program.  You
then can jump back to negative values again.

If I can find all these test programs someday maybe I'll add them to
the test suite.

- Raw text -


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