MOS Source Code
Loading...
Searching...
No Matches
slab.h File Reference
#include <mos/lib/structures/list.h>
#include <mos/lib/sync/spinlock.h>
#include <stddef.h>
+ Include dependency graph for slab.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  slab_t
 

Functions

__BEGIN_DECLS voidslab_alloc (size_t size)
 Allocate a block of memory from the slab allocator.
 
voidslab_calloc (size_t nmemb, size_t size)
 Allocate a block of memory from the slab allocator and zero it.
 
voidslab_realloc (void *addr, size_t size)
 Reallocate a block of memory from the slab allocator.
 
void slab_free (const void *addr)
 Free a block of memory from the slab allocator.
 
slab_tkmemcache_create (const char *name, size_t ent_size)
 
voidkmemcache_alloc (slab_t *slab)
 

Function Documentation

◆ slab_alloc()

__BEGIN_DECLS void * slab_alloc ( size_t size)

Allocate a block of memory from the slab allocator.

Parameters
size
Returns
void*

Definition at line 130 of file slab.c.

Referenced by operator new(), operator new[](), slab_calloc(), and slab_realloc().

+ Here is the call graph for this function:

◆ slab_calloc()

void * slab_calloc ( size_t nmemb,
size_t size )

Allocate a block of memory from the slab allocator and zero it.

Parameters
nmemb
size
Returns
void*

Definition at line 148 of file slab.c.

+ Here is the call graph for this function:

◆ slab_realloc()

void * slab_realloc ( void * addr,
size_t size )

Reallocate a block of memory from the slab allocator.

Parameters
addr
size
Returns
void*

Definition at line 158 of file slab.c.

+ Here is the call graph for this function:

◆ slab_free()

void slab_free ( const void * addr)

Free a block of memory from the slab allocator.

Parameters
addr

Definition at line 200 of file slab.c.

Referenced by slab_realloc().

+ Here is the call graph for this function:

◆ kmemcache_create()

slab_t * kmemcache_create ( const char * name,
size_t ent_size )

Definition at line 219 of file slab.c.

Referenced by setup_xsave_slab().

+ Here is the call graph for this function:

◆ kmemcache_alloc()

void * kmemcache_alloc ( slab_t * slab)

Definition at line 227 of file slab.c.

Referenced by kmemcache_create(), and slab_alloc().

+ Here is the call graph for this function: