Mail Archives: djgpp/1995/10/24/13:14:56
Here are the results of running the test program:
go32 version 1.12.maint3-disp Copyright (C) 1994 DJ Delorie
13697024
-0.010
13664256
Is it reasonable that sprintf allocates 33K?
The test program is:
#include <dpmi.h>
#include <iostream.h>
#include <math.h>
#include <stdio.h>
main() {
char s[100];
cout<<_go32_dpmi_remaining_physical_memory()<<endl;
sprintf(s,"%10.3f",-0.01);
cout<<s<<endl;
cout<<_go32_dpmi_remaining_physical_memory()<<endl;
return 0;
}
Compiled with
gcc leak.cpp -lgpp
Yaron
- Raw text -