Go to the source code of this file.
|
#define | CACHE_PAGE_SIZE 256 |
|
#define | CACHE_NAME_LEN 16 |
|
#define | CACHE_OPT_NONE 0 |
|
◆ kmem_cache_alloc()
void* kmem_cache_alloc |
( |
struct kmem_cache * |
cache, |
|
|
unsigned long |
flags |
|
) |
| |
Allocate a new slab memory.
- Parameters
-
cache | The cache object for managing slabs. |
flags | Not used. |
- Return values
-
void | *: Pointer to the allocated slab memory. |
◆ kmem_cache_create()
struct kmem_cache* kmem_cache_create |
( |
const char * |
name, |
|
|
size_t |
size, |
|
|
size_t |
align, |
|
|
unsigned long |
flags, |
|
|
void(*)(void *) |
ctor |
|
) |
| |
Create a new slab cache.
- Parameters
-
name | Name of the cache. |
size | Size of the slab managed by the cache. |
align | Size of the slab memory should be aligned to. |
flags | Not used. |
ctor | Not used. |
- Return values
-
struct | kmem_cache *: Pointer to the new allocated cache. |
◆ kmem_cache_free()
void kmem_cache_free |
( |
struct kmem_cache * |
cache, |
|
|
void * |
obj |
|
) |
| |
Free the allocated slab memory.
- Parameters
-
cache | The cache object for managing slabs. |
obj | Pointer to the allocated slab memory. |
- Return values
-