Changes in kernel/generic/src/mm/slab.c [7ec3c56:63e27ef] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/slab.c
r7ec3c56 r63e27ef 101 101 */ 102 102 103 #include <assert.h> 103 104 #include <synch/spinlock.h> 104 105 #include <mm/slab.h> 105 106 #include <adt/list.h> 106 #include <mem str.h>107 #include <mem.h> 107 108 #include <align.h> 108 109 #include <mm/frame.h> … … 111 112 #include <arch.h> 112 113 #include <panic.h> 113 #include <debug.h>114 114 #include <bitops.h> 115 115 #include <macros.h> … … 260 260 slab = obj2slab(obj); 261 261 262 ASSERT(slab->cache == cache);262 assert(slab->cache == cache); 263 263 264 264 size_t freed = 0; … … 268 268 269 269 irq_spinlock_lock(&cache->slablock, true); 270 ASSERT(slab->available < cache->objects);270 assert(slab->available < cache->objects); 271 271 272 272 *((size_t *) obj) = slab->nextavail; … … 417 417 slab_magazine_t *lastmag = cache->mag_cache[CPU->id].last; 418 418 419 ASSERT(irq_spinlock_locked(&cache->mag_cache[CPU->id].lock));419 assert(irq_spinlock_locked(&cache->mag_cache[CPU->id].lock)); 420 420 421 421 if (cmag) { /* First try local CPU magazines */ … … 484 484 slab_magazine_t *lastmag = cache->mag_cache[CPU->id].last; 485 485 486 ASSERT(irq_spinlock_locked(&cache->mag_cache[CPU->id].lock));486 assert(irq_spinlock_locked(&cache->mag_cache[CPU->id].lock)); 487 487 488 488 if (cmag) { … … 586 586 NO_TRACE static bool make_magcache(slab_cache_t *cache) 587 587 { 588 ASSERT(_slab_initialized >= 2);588 assert(_slab_initialized >= 2); 589 589 590 590 cache->mag_cache = malloc(sizeof(slab_mag_cache_t) * config.cpu_count, … … 610 610 unsigned int kmflag), size_t (*destructor)(void *obj), unsigned int flags) 611 611 { 612 ASSERT(size > 0);612 assert(size > 0); 613 613 614 614 memsetb(cache, sizeof(*cache), 0); … … 948 948 void *malloc(size_t size, unsigned int flags) 949 949 { 950 ASSERT(_slab_initialized);951 ASSERT(size <= (1 << SLAB_MAX_MALLOC_W));950 assert(_slab_initialized); 951 assert(size <= (1 << SLAB_MAX_MALLOC_W)); 952 952 953 953 if (size < (1 << SLAB_MIN_MALLOC_W)) … … 961 961 void *realloc(void *ptr, size_t size, unsigned int flags) 962 962 { 963 ASSERT(_slab_initialized);964 ASSERT(size <= (1 << SLAB_MAX_MALLOC_W));963 assert(_slab_initialized); 964 assert(size <= (1 << SLAB_MAX_MALLOC_W)); 965 965 966 966 void *new_ptr;
Note:
See TracChangeset
for help on using the changeset viewer.