Mail Archives: djgpp/1998/03/31/21:02:28
Denis V.Sorokovik wrote:
>
> Here is my problem. I write program, that works with memory arrays and
> allocates arrays dynamically. I'm calling malloc(size), working with
> array, then freeing (free(ptr)). dpmi function
> __dpmi_get_free_memory_information says, that largest available free
> block in bytes didn't increases in size, when I freed array, and
> total_number_of_free_pages decreased too. I use DJGPP 2.01, cwsdpmi 4.
> Can anybody helps me with this question?
The answer is quite simple: DJGPP's malloc()/free() does not return
freed memory blocks to the system; it keeps track of them for possible
reuse later. At program termination, all allocated memory is returned
to the DPMI host.
--
John M. Aldrich, aka Fighteer I <fighteer AT cs DOT com> UIN# 7406319
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d- s+:- a-->? C++>$ U@>++$ p>+ L>++ E>++ W++ N++ o+>++ K? w(---)
O- M-- V? PS+ PE Y+ PGP- t+(-) 5- X- R+(++) tv+() b+++ DI++ D++ G>++
e(*)>++++ h!() !r !y+()
------END GEEK CODE BLOCK------
- Raw text -