picox
0.1
|
#include <picox/allocator/xfixed_allocator.h>
マクロ定義 | |
#define | X__IS_VALID_RANGE(x) (x_is_within_ptr(x, self->top, self->top + 1 + (self->block_size * (self->num_blocks - 1)))) |
関数 | |
static void | X__MakeBlocks (XFixedAllocator *self) |
void * | xfalloc_allocate (XFixedAllocator *self) |
void | xfalloc_clear (XFixedAllocator *self) |
void | xfalloc_deallocate (XFixedAllocator *self, void *ptr) |
void | xfalloc_init (XFixedAllocator *self, void *heap, size_t heap_size, size_t block_size) |
void* xfalloc_allocate | ( | XFixedAllocator * | self | ) |
ヒープから1ブロックを取り出して返します
void xfalloc_clear | ( | XFixedAllocator * | self | ) |
ヒープを初期状態に戻します
void xfalloc_deallocate | ( | XFixedAllocator * | self, |
void * | ptr | ||
) |
ヒープにブロックを返却します
ptrがNULLの時は何もしません。
void xfalloc_init | ( | XFixedAllocator * | self, |
void * | heap, | ||
size_t | heap_size, | ||
size_t | block_size | ||
) |
メモリブロックを初期化します
heap | ブロック化するメモリ領域 |
heap_size | heap領域のバイト数 |
block_size | 1ブロックのサイズ |
alignment | ブロックのアラインメント |