mutek/slab.h header reference
[Kernel services module]

The source code of this header can be browsed online.

Description  

Slab allocator is a specialized memory allocator able to efficiently allocate buffers of fixed size.

Members  

Types  

Functions  

Macro  

Members detail  

#define SLAB_GROW(f)  

This macro is declared in mutek/slab.h source file, line 76.

this macro defines the grow policy function prototype for a slab.

This function is called every time the slab needs to grow.

Parameter list:

  • slab: Slab to grow for
  • current: Current allocator item count

The return value is count of items to allocate next

#define SLAB_H_  

This macro is declared in mutek/slab.h source file, line 30.

void * slab_alloc(struct slab_s *slab)  

This function is declared in mutek/slab.h source file, line 134.

this function allocates one element in the slab.

Parameter list:

  • slab: The slab allocator

The return value is a newly allocated item

void slab_cleanup(struct slab_s *slab)  

this function clears the slab.

After calling this function, you may not use any allocated items any more.

Parameter list:

  • slab: Slab to destroy

void slab_free(struct slab_s *slab, void *ptr)  

This function is declared in mutek/slab.h source file, line 157.

this function deallocs one element in the slab.

Parameter list:

  • slab: Slab the pointer belongs to
  • ptr: Pointer to deallocate

typedef void * slab_group_list_entry_t  

This typedef is declared in mutek/slab.h source file, line 64.

typedef struct slab_group_s * slab_group_list_item_t  

This typedef is declared in mutek/slab.h source file, line 64.

typedef void * slab_group_list_root_t  

This typedef is declared in mutek/slab.h source file, line 64.

typedef size_t (slab_grow_func_t)(struct slab_s *slab, size_t current)   

This typedef is declared in mutek/slab.h source file, line 79.

This declaration involves expansion of the SLAB_GROW macro.

void slab_init(struct slab_s *slab, size_t unit_size, slab_grow_func_t *grow, enum mem_scope_e scope)  

this function initializes a new slab.

Parameter list:

  • slab: Slab structure to initialize
  • unit_size: Size for each allocated item
  • grow: Grow policy function
  • scope: Memory allocator scope

struct slab_s  

This struct is declared in mutek/slab.h source file, line 81.

typedef void * slab_unit_list_entry_t  

This typedef is declared in mutek/slab.h source file, line 56.

typedef struct slab_unit_s * slab_unit_list_item_t  

This typedef is declared in mutek/slab.h source file, line 56.

typedef void * slab_unit_list_root_t  

This typedef is declared in mutek/slab.h source file, line 56.

#define GCT_CONTAINER_ALGO_slab_group_list  

This macro is declared in mutek/slab.h source file, line 47.

This macro is for internal use only.

#define GCT_CONTAINER_ALGO_slab_unit_list  

This macro is declared in mutek/slab.h source file, line 45.

This macro is for internal use only.

struct slab_group_s  

This struct is declared in mutek/slab.h source file, line 59.

This struct is for internal use only.

This struct is empty.

See also slab_group_list_item_t.

void * slab_nolock_grow(struct slab_s *slab)  

Grow slab and return one allocated item

This function is for internal use only.

struct slab_unit_s  

This struct is declared in mutek/slab.h source file, line 51.

This struct is for internal use only.

This struct is empty.

See also slab_unit_list_item_t.

Valid XHTML 1.0 StrictGenerated by diaxen on Wed Oct 17 21:18:39 2018 using MkDoc