|
Reduct
v4.0.5-1-g4851deb
A functional and immutable language.
|
Data Structures | |
| struct | reduct_arena_t |
| Arena structure. More... | |
| struct | reduct_arena_chunk_t |
| Arena chunk descriptor. More... | |
| struct | reduct_arena_local_t |
| Per-thread arena-related state structure. More... | |
Macros | |
| #define | REDUCT_ARENA_MIN 1024 |
| The minimum size of an arena in bytes. | |
| #define | REDUCT_ARENA_GROWTH 2 |
| The factor by which we increase the minimum size until the needed capacity is reached./*#end#*/. | |
| #define | REDUCT_ARENA_CHUNK(_arena, _size, _data) ((reduct_arena_chunk_t){(_arena), (_size), (_data)}) |
| Create an arena chunk descriptor. | |
Functions | |
| REDUCT_API void | reduct_arena_local_init (reduct_arena_local_t *local) |
| Initialize a local arena state. | |
| REDUCT_API void | reduct_arena_local_deinit (reduct_arena_local_t *local) |
| Deinitialize a local arena state. | |
| REDUCT_API void | reduct_arena_alloc (struct reduct *reduct, size_t size, reduct_arena_chunk_t *out) |
| Allocate a chunk of memory from a arena. | |
| REDUCT_API void | reduct_arena_alloc_super (struct reduct *reduct, size_t size, reduct_arena_chunk_t *chunk, reduct_arena_chunk_t *out) |
| Allocate a super chunk that starts with the specified chunk. | |
| #define REDUCT_ARENA_MIN 1024 |
| #define REDUCT_ARENA_GROWTH 2 |
| #define REDUCT_ARENA_CHUNK | ( | _arena, | |
| _size, | |||
| _data | |||
| ) | ((reduct_arena_chunk_t){(_arena), (_size), (_data)}) |
| REDUCT_API void reduct_arena_local_init | ( | reduct_arena_local_t * | local | ) |
Initialize a local arena state.
| local | Pointer to the local arena state to initialize. |
| REDUCT_API void reduct_arena_local_deinit | ( | reduct_arena_local_t * | local | ) |
Deinitialize a local arena state.
| local | Pointer to the local arena state to deinitialize. |
| REDUCT_API void reduct_arena_alloc | ( | struct reduct * | reduct, |
| size_t | size, | ||
| reduct_arena_chunk_t * | out | ||
| ) |
Allocate a chunk of memory from a arena.
| reduct | Pointer to the Reduct structure. |
| size | The size of the chunk to allocate in bytes. |
| out | Pointer to store the allocated chunk descriptor. |
| REDUCT_API void reduct_arena_alloc_super | ( | struct reduct * | reduct, |
| size_t | size, | ||
| reduct_arena_chunk_t * | chunk, | ||
| reduct_arena_chunk_t * | out | ||
| ) |
Allocate a super chunk that starts with the specified chunk.
If the chunk is at the end of its arena and there is enough capacity, it will extend the existing allocation.
| reduct | Pointer to the Reduct structure. |
| size | The size of the super chunk to allocate in bytes. |
| chunk | The description of the chunk to extend from. |
| out | Pointer to store the allocated super chunk information. |