Mail Archives: djgpp/1997/03/24/02:53:50
On Fri, 21 Mar 1997, Ilya P. Ryzhenkov wrote:
> AFAIK free() will return mem to local djgpp's heap, so
> OS will not be able to use that mem. Am I right ?
Yes.
> If so, how can I return mem to DPMI server ?
AFAIK, you can't, not without rewriting the code of `sbrk' function.
Currently, it doesn't return memory to the DPMI server at all. If you
are concerned by the possibility that a program consumes more and more
memory from the system (that might be a concern in a program which
runs for prolonged periods of time), perhaps an alternative solution
would be to change (or replace) `malloc' and `free' so that they reuse
available memory more efficiently. This is certainly *much* simpler
than messing with `sbrk' (whose code is very complex, semi-documented
and relies on some tricks required to overcome some problems in the
DPMI spec and bugs of some DPMI hosts).
- Raw text -