- Timestamp:
- Dec 13, 2001, 4:32:57 PM (24 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/initkernel32.cpp
r7567 r7627 1 /* $Id: initkernel32.cpp,v 1.1 1 2001-12-07 14:13:37sandervl Exp $1 /* $Id: initkernel32.cpp,v 1.12 2001-12-13 15:32:34 sandervl Exp $ 2 2 * 3 3 * KERNEL32 DLL entry point … … 57 57 #include <codepage.h> 58 58 #include <process.h> 59 #include <stats.h> 59 60 60 61 #define DBG_LOCALLOG DBG_initterm … … 226 227 DestroyCodeHeap(); 227 228 229 #ifdef DEBUG 230 ULONG totalmemalloc, nrcalls_malloc, nrcalls_free; 231 232 getcrtstat(&nrcalls_malloc, &nrcalls_free, &totalmemalloc); 233 dprintf(("************* KERNEL32 STATISTICS BEGIN *****************")); 234 dprintf(("Total nr of malloc calls %d", nrcalls_malloc)); 235 dprintf(("Total nr of free calls %d", nrcalls_free)); 236 dprintf(("Leaked memory: %d bytes", totalmemalloc)); 237 dprintf(("************* KERNEL32 STATISTICS END *****************")); 238 #endif 239 228 240 //NOTE: Must be done after DestroyTIB 229 241 ClosePrivateLogFiles(); -
trunk/src/odincrt/malloc.cpp
r5090 r7627 1 /* $Id: malloc.cpp,v 1. 5 2001-02-11 10:32:51sandervl Exp $ */1 /* $Id: malloc.cpp,v 1.6 2001-12-13 15:32:17 sandervl Exp $ */ 2 2 /* 3 3 * Project Odin Software License can be found in LICENSE.TXT … … 20 20 void * _IMPORT _LNK_CONV _debug_ucalloc(Heap_t , size_t, size_t ,const char *,size_t); 21 21 22 #ifdef DEBUG 23 unsigned long nrcalls_malloc = 0; 24 unsigned long nrcalls_free = 0; 25 unsigned long totalmemalloc = 0; 26 27 void _LNK_CONV getcrtstat(unsigned long *pnrcalls_malloc, 28 unsigned long *pnrcalls_free, 29 unsigned long *ptotalmemalloc) 30 { 31 *pnrcalls_malloc = nrcalls_malloc; 32 *pnrcalls_free = nrcalls_free; 33 *ptotalmemalloc = totalmemalloc; 34 } 35 #endif 36 22 37 void * _LNK_CONV os2calloc( size_t a, size_t b ) 23 38 { … … 25 40 void *rc; 26 41 42 #ifdef DEBUG 43 totalmemalloc += a*b; 44 nrcalls_malloc++; 45 #endif 27 46 rc = calloc(a,b); 28 47 SetFS(sel); … … 34 53 unsigned short sel = RestoreOS2FS(); 35 54 55 #ifdef DEBUG 56 nrcalls_free++; 57 totalmemalloc -= _msize(a); 58 #endif 36 59 free(a); 37 60 SetFS(sel); … … 43 66 void *rc; 44 67 68 69 #ifdef DEBUG 70 totalmemalloc += a; 71 nrcalls_malloc++; 72 #endif 45 73 rc = malloc(a); 46 74 SetFS(sel); … … 53 81 void *rc; 54 82 83 #ifdef DEBUG 84 totalmemalloc += (b - _msize(a)); 85 #endif 86 55 87 rc = realloc(a, b); 56 88 SetFS(sel); … … 63 95 void *rc; 64 96 97 #ifdef DEBUG 98 totalmemalloc += a*b; 99 nrcalls_malloc++; 100 #endif 101 65 102 rc = _debug_calloc(a,b,c,d); 66 103 SetFS(sel); … … 72 109 unsigned short sel = RestoreOS2FS(); 73 110 111 112 #ifdef DEBUG 113 nrcalls_free++; 114 totalmemalloc -= _msize(a); 115 #endif 74 116 _debug_free(a,b,c); 75 117 SetFS(sel); … … 81 123 void *rc; 82 124 125 #ifdef DEBUG 126 totalmemalloc += a; 127 nrcalls_malloc++; 128 #endif 83 129 rc = _debug_calloc(1,a,b,c); 84 130 SetFS(sel); … … 91 137 void *rc; 92 138 139 #ifdef DEBUG 140 totalmemalloc += (b - _msize(a)); 141 #endif 93 142 rc = _debug_realloc(a,b,c,d); 94 143 SetFS(sel); … … 101 150 void *rc; 102 151 152 #ifdef DEBUG 153 totalmemalloc += b; 154 nrcalls_malloc++; 155 #endif 103 156 rc = _umalloc(a,b); 104 157 SetFS(sel); … … 111 164 void *rc; 112 165 166 #ifdef DEBUG 167 totalmemalloc += b*c; 168 nrcalls_malloc++; 169 #endif 113 170 rc = _ucalloc(a,b,c); 114 171 SetFS(sel); … … 121 178 void *rc; 122 179 180 #ifdef DEBUG 181 totalmemalloc += b; 182 nrcalls_malloc++; 183 #endif 123 184 rc = _debug_ucalloc(a, 1, b,c,d); 124 185 SetFS(sel); … … 131 192 void *rc; 132 193 194 #ifdef DEBUG 195 totalmemalloc += b*c; 196 nrcalls_malloc++; 197 #endif 133 198 rc = _debug_ucalloc(a,b,c,d,e); 134 199 SetFS(sel); -
trunk/src/odincrt/odincrtd.def
r6373 r7627 1 ; $Id: odincrtd.def,v 1. 4 2001-07-20 15:40:30sandervl Exp $1 ; $Id: odincrtd.def,v 1.5 2001-12-13 15:32:17 sandervl Exp $ 2 2 ; Odin VAC++ 3.08 shared multithreaded runtime 3 3 LIBRARY ODINCRTD INITINSTANCE TERMINSTANCE … … 954 954 __divi64 @1031 NONAME 955 955 __divu64 @1032 NONAME 956 957 getcrtstat @1033 NONAME -
trunk/src/user32/Makefile
r6961 r7627 1 # $Id: Makefile,v 1.9 7 2001-10-07 11:48:27 sandervl Exp $1 # $Id: Makefile,v 1.98 2001-12-13 15:32:57 sandervl Exp $ 2 2 3 3 # … … 101 101 $(OBJDIR)\oldnls32.obj \ 102 102 $(OBJDIR)\user32rsrc.obj \ 103 $(OBJDIR)\oslibprf.obj 103 $(OBJDIR)\oslibprf.obj \ 104 $(OBJDIR)\stats.obj 104 105 105 106 -
trunk/src/user32/dc.cpp
r6941 r7627 1 /* $Id: dc.cpp,v 1.11 2 2001-10-03 18:37:51sandervl Exp $ */1 /* $Id: dc.cpp,v 1.113 2001-12-13 15:32:57 sandervl Exp $ */ 2 2 3 3 /* … … 36 36 #include <codepage.h> 37 37 #include <wingdi32.h> 38 #include <stats.h> 38 39 39 40 #define INCLUDED_BY_DC … … 874 875 UnselectGDIObjects(hdc); 875 876 rc = O32_ReleaseDC (0, hdc); 877 STATS_ReleaseDC(hwnd, hdc); 876 878 } 877 879 … … 946 948 947 949 RELEASE_WNDOBJ(wnd); 950 951 STATS_GetDCEx(hwnd, hps, hrgn, flags); 952 948 953 return (HDC)hps; 949 954 } … … 1081 1086 RELEASE_WNDOBJ(wnd); 1082 1087 1088 1089 STATS_GetDCEx(hwnd, pHps->hps, hrgn, flags); 1083 1090 return (HDC)pHps->hps; 1084 1091 -
trunk/src/user32/inituser32.cpp
r7622 r7627 1 /* $Id: inituser32.cpp,v 1. 8 2001-12-13 12:24:42sandervl Exp $ */1 /* $Id: inituser32.cpp,v 1.9 2001-12-13 15:32:57 sandervl Exp $ */ 2 2 /* 3 3 * USER32 DLL entry point … … 47 47 #include <exitlist.h> 48 48 #include <initdll.h> 49 #include <stats.h> 49 50 50 51 #define DBG_LOCALLOG DBG_initterm … … 262 263 SYSCOLOR_Save(); 263 264 CloseSpyQueue(); 265 STATS_DumpStats(); 264 266 dprintf(("user32 exit done\n")); 265 267 }
Note:
See TracChangeset
for help on using the changeset viewer.