Mail Archives: djgpp/1998/09/03/23:15:43
On 4 Sep 98 at 3:28, SuSaNNa wrote:
> When i malloc() some memory, and i free(),
> _go32_dpmi_get_free_memory_information not changes
> why? where is my memory?
>
> in a document about dpmi i was reading:
>
> "when you call free(), go32 doesn't return memory to the system, it just
> adds it to its internal pool of free pages. So from the system point of
> view, thes pages are not 'free' "
That's the answer to your above question -- the memory is reusable by
future mallocs, but as far as the DPMI host is concerned it's not
actually free.
> well, but if i need to "reality" free my memory, What can i do?
Allocate it yourself using DPMI functions to obtain a memory block
from the DPMI server, and free it yourself when you've finished with
it. Look up `__dpmi_allocate_memory' and `__dpmi_free_memory' if
you really need to do this, but why do you really care whether or
not the memory is really free? It'll be paged to disk sooner or
later because it's not being used any more. In a single-tasking
environment, your program is the only one running, and your program
can reuse the memory so there's no problem. By far the most common
multitasking environment is Windows, which is relatively stingy with
memory anyway. It only offers you memory out of a certain quota
anyway, so there's probably plenty left even if you burned up
everything it offered you.
--
george DOT foot AT merton DOT oxford DOT ac DOT uk
- Raw text -