Mail Archives: djgpp/1996/03/06/08:39:17
Using: DJGPP V2.0
Hi djgpp gurus !
I have a little problem when I want to detect available memory with
djgpp V2. (I think this is about the same with v1.12m4).
Here is a little program that demonstrate the problem. The values returned
by the prog are quite strange. look by yourself.
Are there ather ways to get available memory ?
Thanks.
-- Sample program memory.cc ----------
#include <stdlib.h>
#include <dpmi.h>
#include <stdio.h>
void PrintFreeMem(void)
{ printf("Free Physical memory : %uld bytes\n",_go32_dpmi_remaining_physical_memory());
printf("Free Virtual memory : %uld bytes\n",_go32_dpmi_remaining_virtual_memory());
}
int main()
{ printf("MEMORY free test - DJGPP compiler\n");
PrintFreeMem();
printf("\nAllocation 34658 bytes...\n\n");
char *Dummy=(char*)malloc(34658);
PrintFreeMem();
printf("\nFreeing the memory allocated\n\n");
free(Dummy);
PrintFreeMem();
printf("\nDone.\n");
return 0;
}
--
Eric Nicolas <nicolas AT dsys DOT ceng DOT cea DOT fr>
- Raw text -