Rev 1248 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1248 | Rev 1288 | ||
---|---|---|---|
Line 275... | Line 275... | ||
275 | spinlock_lock(&cache->slablock); |
275 | spinlock_lock(&cache->slablock); |
276 | 276 | ||
277 | if (list_empty(&cache->partial_slabs)) { |
277 | if (list_empty(&cache->partial_slabs)) { |
278 | /* Allow recursion and reclaiming |
278 | /* Allow recursion and reclaiming |
279 | * - this should work, as the slab control structures |
279 | * - this should work, as the slab control structures |
280 | * are small and do not need to allocte with anything |
280 | * are small and do not need to allocate with anything |
281 | * other ten frame_alloc when they are allocating, |
281 | * other than frame_alloc when they are allocating, |
282 | * that's why we should get recursion at most 1-level deep |
282 | * that's why we should get recursion at most 1-level deep |
283 | */ |
283 | */ |
284 | spinlock_unlock(&cache->slablock); |
284 | spinlock_unlock(&cache->slablock); |
285 | slab = slab_space_alloc(cache, flags); |
285 | slab = slab_space_alloc(cache, flags); |
286 | if (!slab) |
286 | if (!slab) |
Line 887... | Line 887... | ||
887 | idx = fnzb(size-1) - SLAB_MIN_MALLOC_W + 1; |
887 | idx = fnzb(size-1) - SLAB_MIN_MALLOC_W + 1; |
888 | 888 | ||
889 | return slab_alloc(malloc_caches[idx], flags); |
889 | return slab_alloc(malloc_caches[idx], flags); |
890 | } |
890 | } |
891 | 891 | ||
892 | - | ||
893 | void free(void *obj) |
892 | void free(void *obj) |
894 | { |
893 | { |
895 | slab_t *slab; |
894 | slab_t *slab; |
896 | 895 | ||
897 | if (!obj) return; |
896 | if (!obj) return; |