|
nfs-ganesha 1.4
|
Abstract memory shims to allow swapping out allocators. More...
#include <stdlib.h>#include <string.h>#include <assert.h>Go to the source code of this file.
Classes | |
| struct | pool_substrate_vector |
| A function vector defining a pool substrate. More... | |
| struct | pool |
| Type representing a pool. More... | |
Typedefs | |
| typedef struct pool | pool_t |
| typedef pool_t *(* | pool_initializer_t )(size_t size, void *param) |
| Abstract type of pool initializer. | |
| typedef void(* | pool_destroyer_t )(pool_t *pool) |
| Abstract type of pool destroyer. | |
| typedef void *(* | pool_allocator_t )(pool_t *pool) |
| Abstract type of pool allocator. | |
| typedef void(* | pool_freer_t )(pool_t *pool, void *object) |
| Abstract type of pool freer. | |
| typedef void(* | pool_constructor_t )(void *object, void *parameters) |
| Object constructor. | |
| typedef void(* | pool_destructor_t )(void *object) |
| Object destructor. | |
Abstract memory shims to allow swapping out allocators.
Definition in file abstract_mem.h.
| typedef void*(* pool_allocator_t)(pool_t *pool) |
Abstract type of pool allocator.
This type represents that of a function to perform the allocation of an object in the underlying pool implementation. It must not call the constructor function, leaving that to the wrapper.
| [in] | pool | The pool from which to allocate. |
Definition at line 239 of file abstract_mem.h.
| typedef void(* pool_constructor_t)(void *object, void *parameters) |
Object constructor.
Functions of this type are used to initialize objects newly allocated from the pool.
| [out] | object | The newly allocated object to be initialized |
| [in] | parameters | Parameters to be used in initialization |
Definition at line 281 of file abstract_mem.h.
| typedef void(* pool_destroyer_t)(pool_t *pool) |
Abstract type of pool destroyer.
This type represents that of a function to perform the destruction of an underlying pool. It should do any substrate specific cleanup and then deallocate the memory pointed to by the pool argment.
| [in] | pool | The pool to destroy |
Definition at line 225 of file abstract_mem.h.
| typedef void(* pool_destructor_t)(void *object) |
Object destructor.
Functions of this type are used to finalize objects before they are returned to the pool.
| [in,out] | object | The object to be finalized |
Definition at line 293 of file abstract_mem.h.
| typedef void(* pool_freer_t)(pool_t *pool, void *object) |
Abstract type of pool freer.
This type represents that of a function to free an object in the underlying pool implementation. It must not call the destructor function, leaving that to the wrapper.
| [in] | pool | The pool to which to return the object |
| [in] | object | The object to free |
Definition at line 253 of file abstract_mem.h.
| typedef pool_t*(* pool_initializer_t)(size_t size, void *param) |
Abstract type of pool initializer.
This type represents that of a function to perform the initialization of the underlying pool. It should allocate the pool_t and other memory it needs in a contiguous block, initialize its own substrate-specific data, and return the pointer to the pool_t (without filling out any of the fields in the pool_t proper.)
| [in] | size | Size of the objects to be allocated |
| [in] | param | Substrate specific parameters |
Definition at line 212 of file abstract_mem.h.
Definition at line 194 of file abstract_mem.h.
1.7.3