Date: Mon, 24 Mar 1997 10:34:46 +0300 (IDT) From: Eli Zaretskii To: "Ilya P. Ryzhenkov" cc: djgpp AT delorie DOT com Subject: Re: malloc & m/tasking OS In-Reply-To: <33334341.471F@spy.isp.nsc.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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).