ctrump/common/mempool.h File Reference

メモリアロケータ More...

#include "ctrump/common/dll.h"

Include dependency graph for mempool.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ctrump_mempool
 メモリアロケータ More...

Defines

#define ctrump_mempool_alloc(p, s)   ctrump_mempool_alloc_align(p, 3, s)
 allocate memory from pool. memory is aligned to 8.

Functions

CTRUMP_EXTDEF void ctrump_mempool_init (struct ctrump_mempool *p, unsigned int size_hint)
 create mempool
CTRUMP_EXTDEF void ctrump_mempool_destroy (struct ctrump_mempool *p)
 delete mempool
CTRUMP_EXTDEF 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'.
CTRUMP_EXTDEF char * ctrump_mempool_strdup (struct ctrump_mempool *p, char *str)


Detailed Description

メモリアロケータ

関連するオブジェクトをまとめて解放したい場合に使うアロケータ

Definition in file mempool.h.


Define Documentation

#define ctrump_mempool_alloc ( p,
 )     ctrump_mempool_alloc_align(p, 3, s)


Function Documentation

CTRUMP_EXTDEF 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'.

Parameters:
p pool object
align_shift align
size object size
Returns:
allocated memory

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().

CTRUMP_EXTDEF void ctrump_mempool_destroy ( struct ctrump_mempool p  ) 

CTRUMP_EXTDEF void ctrump_mempool_init ( struct ctrump_mempool p,
unsigned int  size_hint 
)

CTRUMP_EXTDEF char* ctrump_mempool_strdup ( struct ctrump_mempool p,
char *  str 
)

Definition at line 121 of file mempool.c.

References ctrump_mempool_alloc.


Generated on Tue Mar 31 20:19:24 2009 for ctrump by  doxygen 1.5.6