Mail Archives: djgpp-workers/1998/04/20/09:23:39
> Programs which call `coreleft' want to know how much memory they can
> use. So I don't think it is meaningless. The DPMI calls which return
> free memory are okay, but they don't include the free blocks already
> sbrk'ed by the program. Adding this latter memory will get the job done,
> I think.
But the free blocks internally managed by malloc() are in size bins, so if
the user wants a big single allocation that memory is essentially not free.
If you are going to mess with it, then it ought to be something like the
non-sbrked available virtual memory, rounded down to the nearest power of
two (or whatever the current malloc does in that case).
Or just return that value maxed with 640K ;-)
- Raw text -