- Timestamp:
- 2010-01-14T18:46:45+13:00 (14 years ago)
- Location:
- main/trunk/greenstone2/common-src/src/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/common-src/src/lib/gsdltools.cpp
r18880 r21454 279 279 return (i == 0); 280 280 } 281 282 283 #if defined(__WIN32__) 284 // A very useful function to call to debug mysterious heap memory errors when 285 // their cause isn't clear in the Vis Studio debugger. Call it from various 286 // places of the code and narrow down the point at which the heap memory becomes 287 // corrupted. The title param can be the method this function is called from. 288 void check_system_heap(char* title) 289 { 290 int heapstatus = _heapchk(); 291 292 char message[1024]; 293 294 switch (heapstatus) { 295 case _HEAPOK: 296 sprintf(message,"%s","OK - heap is fine"); 297 break; 298 case _HEAPEMPTY: 299 sprintf(message,"%s","OK - heap is empty"); 300 break; 301 case _HEAPBADBEGIN: 302 sprintf(message,"%s","ERROR - bad start of heap"); 303 break; 304 case _HEAPBADNODE: 305 sprintf(message,"%s","Error - bad node in heap"); 306 break; 307 default: 308 sprintf(message,"%s: %d","Unrecognized heap status",heapstatus); 309 } 310 311 MessageBox (NULL, message, title, MB_OK); 312 } 313 314 #endif -
main/trunk/greenstone2/common-src/src/lib/gsdltools.h
r17545 r21454 73 73 bool perl_ok (ostream &logout); 74 74 75 #if defined(__WIN32__) 76 void check_system_heap(char* title); 77 #endif 78 75 79 #endif 76 80
Note:
See TracChangeset
for help on using the changeset viewer.