Subversion Repositories HelenOS

Compare Revisions

Regard whitespace Rev 1949 → Rev 1950

/trunk/kernel/doc/mm
80,7 → 80,7
will never return NULL, but it CAN sleep indefinitely. The caller
does not have to check the return value.
 
3) The maximum size that can be allocated using malloc is 128K
3) The maximum size that can be allocated using malloc is 256K
 
Rules 1) and 2) apply to slab_alloc as well. Using SLAB allocator
to allocate too large values is not recommended.
/trunk/kernel/generic/include/mm/slab.h
102,7 → 102,7
link_t partial_slabs; /**< List of partial slabs */
SPINLOCK_DECLARE(slablock);
/* Magazines */
link_t magazines; /**< List o full magazines */
link_t magazines /**< List o full magazines */
SPINLOCK_DECLARE(maglock);
 
/** CPU cache */
/trunk/kernel/generic/src/mm/slab.c
137,11 → 137,11
 
/** Slab descriptor */
typedef struct {
slab_cache_t *cache; /**< Pointer to parent cache */
link_t link; /* List of full/partial slabs */
void *start; /**< Start address of first available item */
count_t available; /**< Count of available items in this slab */
index_t nextavail; /**< The index of next available item */
slab_cache_t *cache; /**< Pointer to parent cache. */
link_t link; /**< List of full/partial slabs. */
void *start; /**< Start address of first available item. */
count_t available; /**< Count of available items in this slab. */
index_t nextavail; /**< The index of next available item. */
}slab_t;
 
#ifdef CONFIG_DEBUG
289,9 → 289,7
return NULL;
spinlock_lock(&cache->slablock);
} else {
slab = list_get_instance(cache->partial_slabs.next,
slab_t,
link);
slab = list_get_instance(cache->partial_slabs.next, slab_t, link);
list_remove(&slab->link);
}
obj = slab->start + slab->nextavail * cache->size;
899,7 → 897,8
{
slab_t *slab;
 
if (!obj) return;
if (!obj)
return;
 
slab = obj2slab(obj);
_slab_free(slab->cache, obj, slab);