/**************/ /* cliptest.c */ /**************/ #include #include #include #include #define KOKO 1L //#define GLOBAL char *WindowName = "memtest"; LONG n=0; LONG start; void tulosta(HDC hDC) { char s[30]; LONG free; sprintf(s," %d ",n); TextOut(hDC,10,10,s,strlen(s)); sprintf(s," %ld ",free=GetFreeSpace(0)); TextOut(hDC,120,10,s,strlen(s)); sprintf(s," %ld ",start-free); TextOut(hDC,220,10,s,strlen(s)); sprintf(s," %ld ",(LONG)((start-free)/n)); TextOut(hDC,320,10,s,strlen(s)); } /****************************************************************************/ void MyDraw(HWND hWnd,HDC hDC) { #pragma argsused // HGLOBAL gh; start=GetFreeSpace(0); #ifdef GLOBAL while ( (GlobalAlloc(GMEM_MOVEABLE,KOKO)) != 0 ) { #else while ( (malloc(KOKO)) != 0 ) { #endif if ( ++n % 10 == 0 ) tulosta(hDC); } tulosta(hDC); }