Mail Archives: djgpp-workers/2002/05/17/03:25:14
> From: sandmann AT clio DOT rice DOT edu
> Date: Thu, 16 May 2002 22:50:09 -0500 (CDT)
>
> > So, what does it do with that memory. Is it simply abandoned?
>
> No, it's just sitting there, still allocated, waiting for you to ask
> for it again with sbrk() with a positive value.
>
> > What does it do if the argument is the negative of the total size
> > allocated continuously so far?
>
> It would set the selector limits to zero, the start of the allocation
> space to zero, and you would die very badly
I'm confused: didn't you just tell that negative arguments to sbrk
don't modify the memory allocation as far as the DPMI host is
concerned? That would mean we still own the memory the application
wanted to return, and thus the selector limits should not change at
all. All that should have changed is the value stored in
_what_size_app_thinks_it_is.
In other words, I thought the selector limit (and, possibly, the base
address) only changes when we allocate _additional_ memory off the
DPMI. What am I missing?
- Raw text -