Mail Archives: djgpp/1997/01/09/10:54:39
From: pajonk AT ajax DOT umcs DOT lublin DOT pl (Grzegorz Ludorowski)
Date: 4 Jan 1997 15:20:46 GMT
I've got a problem with "free" (or "xfree") routines - it's silly I know,
but they seems not to work...
I tried program listed below, and after freeing that "dummy" pointer,
free memory doesn't change... If anybody coud test it and help.
#include <stdio.h>
#include <dpmi.h>
#include <crt0.h>
int *dummy;
void main () {
printf ("At start: physical mem %d virtual mem %d\n",_go32_dpmi_remaining_physical_memory (),_go32_dpmi_remaining_virtual_memory ());
dummy = (int*) malloc (100000);
printf ("After allocating 100kbytes: physical mem %d virtual mem %d\n",_go32_dpmi_remaining_physical_memory (),_go32_dpmi_remaining_virtual_memory ());
free (dummy);
printf ("After releasing 100kbytes: physical mem %d virtual mem %d\n",_go32_dpmi_remaining_physical_memory (),_go32_dpmi_remaining_virtual_memory ());
}
No problem! The memory is not returned to DPMI when free()'d only to the
malloc() memory pool. This is why _dpmi_remaining_physical_memory() &
_go32_dpmi_remaining_virtual_memory() report no change.
--
Art S. Kagel, kagel AT quasar DOT bloomberg DOT com
A proverb is no proverb to you 'till life has illustrated it. -- John Keats
- Raw text -