Changeset 21916 for trunk/src/kernel32/heapshared.cpp
- Timestamp:
- Dec 18, 2011, 10:28:22 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 bin 2 Makefile.inc 1 env.cmd 2 LocalConfig.kmk
-
-
Property svn:mergeinfo
set to
/branches/gcc-kmk merged eligible
- Property svn:ignore
-
trunk/src/kernel32/heapshared.cpp
r21302 r21916 8 8 * 9 9 * TODO: Not process/thread safe (initializing/destroying heap) 10 * 10 * 11 11 * ASSUMPTION: Rtl library takes care of protection of heap increase/decrease 12 12 * (from multiple threads/processes) … … 31 31 #include "dbglocal.h" 32 32 33 #define MAX_HEAPSIZE 33 #define MAX_HEAPSIZE (2048*1024) 34 34 #define MAX_HEAPPAGES (MAX_HEAPSIZE/PAGE_SIZE) 35 35 #define INCR_HEAPSIZE (16*1024) 36 36 37 // Global DLL Data38 #pragma data_seg(_GLOBALDATA)39 Heap_t sharedHeap = 0; 40 static PVOID pSharedMem = NULL; 41 static BYTE pageBitmap[MAX_HEAPPAGES] = {0}; 42 static ULONG refCount = 0; 43 #pragma data_seg() 37 // 38 // Global DLL Data (keep it in sync with globaldata.asm!) 39 // 40 extern Heap_t sharedHeap; // = 0 41 extern PVOID pSharedMem; // = NULL 42 extern BYTE pageBitmap[MAX_HEAPPAGES]; // = {0} 43 extern ULONG refCount; // = 0; 44 44 45 45 static int privateRefCount = 0; … … 158 158 dprintf(("KERNEL32: GetPageRangeFree(%08xh)", pageoffset)); 159 159 160 for(int i=pageoffset;i<MAX_HEAPPAGES;i++) { 160 int i; 161 for(i=pageoffset;i<MAX_HEAPPAGES;i++) { 161 162 if(pageBitmap[i] == 1) { 162 163 break; … … 184 185 { 185 186 int nrpagesfree = GetPageRangeFree(i); 186 if(nrpagesfree >= *size/PAGE_SIZE) 187 if(nrpagesfree >= *size/PAGE_SIZE) 187 188 { 188 189 newblock = (PVOID)((ULONG)pSharedMem + i*PAGE_SIZE); … … 254 255 //****************************************************************************** 255 256 //****************************************************************************** 256 void * _System _debug_smalloc(int size, c har *pszFile, int linenr)257 void * _System _debug_smalloc(int size, const char *pszFile, int linenr) 257 258 { 258 259 void *chunk; … … 268 269 //****************************************************************************** 269 270 //****************************************************************************** 270 void * _System _debug_smallocfill(int size, int filler, c har *pszFile, int linenr)271 void * _System _debug_smallocfill(int size, int filler, const char *pszFile, int linenr) 271 272 { 272 273 void *chunk; … … 285 286 //****************************************************************************** 286 287 //****************************************************************************** 287 void _System _debug_sfree(void *chunk, c har *pszFile, int linenr)288 void _System _debug_sfree(void *chunk, const char *pszFile, int linenr) 288 289 { 289 290 dprintf(("_sfree %x", chunk));
Note:
See TracChangeset
for help on using the changeset viewer.