Introduction   API Reference   Examples   Index  

slab.h File Reference

Slab allocator API. More...

#include <l4/sys/linkage.h>
#include <l4/sys/l4int.h>
#include <l4/env/cdefs.h>

Go to the source code of this file.

Data Structures

struct  l4slab_cache

Typedefs

typedef struct l4slab_slab l4slab_slab_t
typedef struct l4slab_cache l4slab_cache_t
 Slab cache descriptor type.
typedef L4_CV void *(* l4slab_grow_fn_t )(l4slab_cache_t *cache, void **data)
 Cache grow callback function.
typedef L4_CV void(* l4slab_release_fn_t )(l4slab_cache_t *cache, void *buffer, void *data)
 Cache release callback function.

Functions

L4_CV int l4slab_cache_init (l4slab_cache_t *cache, l4_size_t size, unsigned int max_free, l4slab_grow_fn_t grow_fn, l4slab_release_fn_t release_fn)
 Initialize slab cache.
L4_CV void l4slab_destroy (l4slab_cache_t *cache)
 Destroy slab cache.
L4_CV void * l4slab_alloc (l4slab_cache_t *cache)
 Allocate object.
L4_CV void l4slab_free (l4slab_cache_t *cache, void *objp)
 Release object.
L4_CV void l4slab_add_slab (l4slab_cache_t *cache, void *buffer, void *data)
 Add a slab to the slab cache.
L4_CV void l4slab_set_data (l4slab_cache_t *cache, void *data)
 Set cache application data pointer.
L4_CV void * l4slab_get_data (l4slab_cache_t *cache)
 Get cache application data.
L4_CV void l4slab_dump_cache (l4slab_cache_t *cache, int dump_free)
 Dump cache slab list.
L4_CV void l4slab_dump_cache_free (l4slab_cache_t *cache)
 Dump cache free slab list.


Detailed Description

Slab allocator API.

Date:
2006-12-18
Author:
Lars Reuther <reuther@os.inf.tu-dresden.de>

Christian Helmuth <ch12@os.inf.tu-dresden.de>

Definition in file slab.h.


Typedef Documentation

typedef struct l4slab_slab l4slab_slab_t

Slab descriptor type

Definition at line 39 of file slab.h.


Slab Memory Allocator Reference Manual, written by Lars Reuther  © 2000-2003