#include "mempool.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
Go to the source code of this file.
Functions | |
void | ctrump_mempool_init (struct ctrump_mempool *pool, unsigned int size_hint) |
create mempool | |
void | ctrump_mempool_destroy (struct ctrump_mempool *pool) |
delete mempool | |
void * | ctrump_mempool_alloc_align (struct ctrump_mempool *pool, unsigned int align_shift, unsigned int size) |
allocate memory from pool. memory is aligend to `2^align'. | |
char * | ctrump_mempool_strdup (struct ctrump_mempool *p, char *str) |
Definition in file mempool.c.
void* ctrump_mempool_alloc_align | ( | struct ctrump_mempool * | p, | |
unsigned int | align_shift, | |||
unsigned int | size | |||
) |
allocate memory from pool. memory is aligend to `2^align'.
p | pool object | |
align_shift | align | |
size | object size |
Definition at line 67 of file mempool.c.
References ctrump_mempool::data_entry, ctrump_mempool::entry_byte_pos, ctrump_mempool::entry_byte_remain, ctrump_mempool::entry_byte_size, ctrump_mempool::entry_index, and ctrump_mempool::entry_num.
Referenced by ctrump_intern().
void ctrump_mempool_destroy | ( | struct ctrump_mempool * | pool | ) |
delete mempool
Definition at line 54 of file mempool.c.
References ctrump_mempool::data_entry, and ctrump_mempool::entry_index.
Referenced by classify_memop(), ctrump_analyze(), ctrump_analyze_loop(), ctrump_build_cfg(), ctrump_destroy_symtab(), ctrump_type_env_destroy(), EnvObject_dealloc(), and get_distance_vector().
void ctrump_mempool_init | ( | struct ctrump_mempool * | pool, | |
unsigned int | size_hint | |||
) |
create mempool
Definition at line 41 of file mempool.c.
References ctrump_mempool::data_entry, ctrump_mempool::entry_byte_pos, ctrump_mempool::entry_byte_remain, ctrump_mempool::entry_byte_size, ctrump_mempool::entry_index, and ctrump_mempool::entry_num.
Referenced by classify_memop(), ctrump_analyze(), ctrump_analyze_loop(), ctrump_build_cfg(), ctrump_indent(), ctrump_init_symtab(), ctrump_prog_file2pprint_format(), ctrump_type_env_init(), env_Init(), and get_distance_vector().
char* ctrump_mempool_strdup | ( | struct ctrump_mempool * | p, | |
char * | str | |||
) |