Changeset 541 for Whitix/branches/hybrid/memory/slab.c
- Timestamp:
- 05/24/08 09:55:50 (6 months ago)
- Files:
-
- 1 modified
-
Whitix/branches/hybrid/memory/slab.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/hybrid/memory/slab.c
r495 r541 22 22 #include <error.h> 23 23 #include <i386/i386.h> 24 #include <imports.h> 24 25 25 26 /* … … 97 98 if (i == count(cacheSizes)) /* Too big */ 98 99 { 99 printf("malloc(%u) failed\n",size);100 KePrint("malloc(%u) failed\n",size); 100 101 IrqRestoreFlags(flags); 101 102 return NULL; … … 165 166 166 167 /* FIXME! */ 167 printf("free did not free %#X (from %#X)\n",p,__builtin_return_address(0));168 KePrint("free did not free %#X (from %#X)\n",p,__builtin_return_address(0)); 168 169 cli(); hlt(); 169 170 } … … 326 327 } 327 328 328 printf("MemCacheAlloc(%#X) - failed to allocate memory\n",cache);329 KePrint("MemCacheAlloc(%#X) - failed to allocate memory\n",cache); 329 330 IrqRestoreFlags(flags); 330 331 /* Shouldn't get here, as all memory requests should be satifisted by adding slabs */ … … 413 414 SYMBOL_EXPORT(MemCacheCreate); 414 415 416 DWORD functions[]= 417 { 418 (DWORD)malloc, 419 (DWORD)free, 420 (DWORD)MemCacheCreate, 421 (DWORD)MemCacheAlloc, 422 (DWORD)MemCacheFree, 423 }; 424 415 425 int SlabInit() 416 426 { … … 418 428 419 429 /* Set up the cache cache */ 420 ListAdd(&cacheList, &cacheCache.list);430 ListAdd(&cacheList, &cacheCache.list); 421 431 422 432 /* Now start allocating caches */ … … 430 440 if (!cacheSizes[i].cache) 431 441 { 432 printf("Malloc slab allocation failed!\n");442 KePrint("Malloc slab allocation failed!\n"); 433 443 return -ENOMEM; 434 444 } 435 445 } 436 446 447 ResolveSetMemFunctions(functions); 448 437 449 return 0; 438 450 } 451 452 ModuleInit(SlabInit);