Mail Archives: djgpp-workers/2001/07/04/02:30:02
On Tue, 3 Jul 2001, Matthew Conte wrote:
> > If that doesn't work, I think we can safely decline anything above 2GB,
> > which will avoid the signed/unsigned nuisance (inside malloc as well).
>
> careful: sbrk() will accept negative values.
Of course, it can: that's how you release memory to the system. (Our
`sbrk' doesn't release memory, but it does support negative
arguments.)
But I don't understand the ``careful'' part: the fact that unsigned
values larger than 2GB can be interpreted as negative is _precisely_
the reason I suggested to stop at 2GB (Charles points out that 2GB
minus 64KB is a better value). This number cannot be interpreted as a
negative one, so where's the problem?
Note that I was talking about arguments to `malloc', not to `sbrk',
and `malloc' doesn't allow negative arguments. Did you perhaps think
that I was suggesting that `sbrk' fails for > 2GB? If so, this is not
a problem with `malloc'.
- Raw text -