Mail Archives: djgpp/1999/07/28/19:50:24
Hello Rolf,
>
> OK, I'm not sure if I understand what you are saying, but I'm guessing you
>meant that you can only allocate 64 Megs and any attempt to get higher fails.
>If that is the problem, then I have an idea. If you use sbrk() to allocate
>memory, you can get it 1 byte at a time, without worrying about malloc headers
>or rounding up to a power of 2 stuff (I don't know if that is still a problem in
>the current version). Either way, you can store the value of "sbrk(0)" into a
>"char*", then continuously call "sbrk(1)" until it returns an error value. When
>it returns an error, that means that your original "char*" now points to all
>available ram.
yes, with sbrk() it it better, because I resumed that free() would
work with malloc(), but it doesn't. But with sbrk() I can only access
64 MB too under DOS, under DOS-Box in Win98 in comparison all of the
96 MB, but I don't know if it is virtual memory. What make I wrong?
Greetings, Winfried
- Raw text -