Changeset 13 for trunk/include/helpers/memdebug.h
- Timestamp:
- Nov 23, 2000, 7:36:41 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/memdebug.h
r7 r13 41 41 extern PFNCBMEMDLOG G_pMemdLogFunc; 42 42 43 /* ****************************************************************** 44 * 45 * Private declarations 46 * 47 ********************************************************************/ 48 49 #ifdef MEMDEBUG_PRIVATE 50 51 BOOL memdLock(VOID); 52 53 VOID memdUnlock(VOID); 54 55 /* 56 *@@ HEAPITEM: 57 * informational structure created for each 58 * malloc() call by memdMalloc. These are stored 59 * in a global linked list (G_pHeapItemsRoot). 60 * 61 * We cannot use the linklist.c functions for 62 * managing the linked list because these use 63 * malloc in turn, which would lead to infinite 64 * loops. 65 * 66 *@@added V0.9.3 (2000-04-11) [umoeller] 67 */ 68 69 typedef struct _HEAPITEM 70 { 71 struct _HEAPITEM *pNext; // next item in linked list or NULL if last 72 73 void *pAfterMagic; // memory pointer returned by memdMalloc; 74 // this points to after the magic string 75 unsigned long ulSize; // requested size (without magic head and tail) 76 77 const char *pcszSourceFile; // as passed to memdMalloc 78 unsigned long ulLine; // as passed to memdMalloc 79 const char *pcszFunction; // as passed to memdMalloc 80 81 DATETIME dtAllocated; // system date/time at time of memdMalloc call 82 83 ULONG ulTID; // thread ID that memdMalloc was running on 84 85 BOOL fFreed; // TRUE only after item has been freed by memdFree 86 } HEAPITEM, *PHEAPITEM; 87 88 extern PHEAPITEM G_pHeapItemsRoot; 89 extern ULONG G_ulItemsReleased; 90 extern ULONG G_ulBytesReleased; 91 92 #endif // MEMDEBUG_PRIVATE 93 94 /* ****************************************************************** 95 * 96 * Publics 97 * 98 ********************************************************************/ 99 43 100 void* memdMalloc(size_t stSize, 44 101 const char *pcszSourceFile, … … 57 114 const char *pcszFunction); 58 115 116 void* memdRealloc(void *p, 117 size_t stSize, 118 const char *pcszSourceFile, 119 unsigned long ulLine, 120 const char *pcszFunction); 121 59 122 unsigned long memdReleaseFreed(void); 60 123 … … 64 127 #define malloc(ul) memdMalloc(ul, __FILE__, __LINE__, __FUNCTION__) 65 128 #define calloc(n, size) memdCalloc(n, size, __FILE__, __LINE__, __FUNCTION__) 129 #define realloc(p, ul) memdRealloc(p, ul, __FILE__, __LINE__, __FUNCTION__) 66 130 #define free(p) memdFree(p, __FILE__, __LINE__, __FUNCTION__) 67 131 … … 79 143 #ifdef PM_INCLUDED 80 144 /******************************************************************** 81 * *82 * XFolder debugging helpers *83 * *145 * 146 * XFolder debugging helpers 147 * 84 148 ********************************************************************/ 85 149 … … 94 158 95 159 /* ****************************************************************** 96 * *97 * Heap debugging window *98 * *160 * 161 * Heap debugging window 162 * 99 163 ********************************************************************/ 100 164
Note:
See TracChangeset
for help on using the changeset viewer.