libsent/src/util/mybmalloc.c

ブロック単位の動的メモリ確保 [詳細]

#include <sent/stddefs.h>

mybmalloc.cのインクルード依存関係図

ソースコードを見る。

データ構造

struct  _linked_buffer
 Linked data structure to hold malloced areas [詳細]

マクロ定義

#define MYBMALLOC_LINKED   1
 Use improved version that enables freeing

型定義

typedef _linked_buffer * LINKED_BUFFER
 Linked data structure to hold malloced areas

関数

void mybmalloc_set_param ()
void * mybmalloc (int size)
void mybmalloc_free (void)
char * mybstrdup (char *s)
void * mybmalloc2 (int size, BMALLOC_BASE **list)
char * mybstrdup2 (char *s, BMALLOC_BASE **list)
void mybfree2 (BMALLOC_BASE **list)

変数

static boolean mybmalloc_initialized = FALSE
 TRUE if mybmalloc has already initialized
static char * current = NULL
 Pointer to the current block
static char * nowp = NULL
 Pointer to the current allocating point in the block
static char * endp = NULL
 Pointer at the end of the current block
static unsigned int blocksize
 Block size in bytes
static int align
 Allocation alignment size in bytes
static unsigned int align_mask
 Bit mask to compute the actual aligned memory size
static LINKED_BUFFER first_linked_buffer = NULL
 Pointer to the first linked buffer
static LINKED_BUFFER last_linked_buffer = NULL
 Pointer to the last linked buffer


説明

ブロック単位の動的メモリ確保

作者:
Akinobu LEE
日付:
Thu Feb 17 16:14:59 2005
このファイルには,要求されたサイズごとではなく,定められた一定の 大きさ単位でメモリを確保する関数が定義されています.これを用いることで, 細かい単位で大量にメモリ割り付けする際に起こるメモリ管理のオーバヘッドを 改善できます.これらの関数は,主に言語モデルや音響モデルの読み込みに 用いられています.

Revision
1.5

mybmalloc.c で定義されています。


関数

void mybmalloc_set_param (  ) 

Set block size and memory alignment factor.

mybmalloc.c の 70 行で定義されています。

参照元 mybmalloc()・mybmalloc2()・system_bootup().

void* mybmalloc ( int  size  ) 

Malloc specified size and return the pointer.

引数:
size [in] required size in bytes
戻り値:
pointer to the allocated area.

mybmalloc.c の 102 行で定義されています。

参照元 mybstrdup().

void mybmalloc_free ( void   ) 

Free all the allocated area.

mybmalloc.c の 180 行で定義されています。

char* mybstrdup ( char *  s  ) 

String duplication using mybmalloc().

引数:
s [in] string to be duplicated
戻り値:
pointer to the newly allocated string.

mybmalloc.c の 210 行で定義されています。

void* mybmalloc2 ( int  size,
BMALLOC_BASE **  list 
)

Another version of memory block allocation, used for tree lexicon.

引数:
size [in] memory size to be allocated
list [i/o] total memory management information (will be updated here)
戻り値:
pointer to the newly allocated area.

mybmalloc.c の 228 行で定義されています。

参照元 add_to_error()・add_wacc()・bt_relocate_rw()・dens_new()・dens_read()・get_back_trellis_end()・hmm_add_physical_to_logical()・hmm_add_pseudo_phones_sub()・htk_hmmdata_new()・htk_hmmdata_read()・make_hmm_basephone_list()・mybstrdup2()・outprob_cache_extend()・rd_data()・rd_dens()・rd_state()・rd_tmix()・rd_trans()・rd_var()・rdhmmlist()・rdn_str()・state_new()・state_read()・tmix_create_codebook_index()・tmix_read()・trans_new()・trans_read()・var_new()・var_read()・voca_load_htkdict_line()・wchmm_add_word()・wchmm_duplicate_state().

char* mybstrdup2 ( char *  s,
BMALLOC_BASE **  list 
)

String duplication using mybmalloc2().

引数:
s [in] string to be duplicated
list [i/o] total memory management information pointer
戻り値:
pointer to the newly allocated string.

mybmalloc.c の 265 行で定義されています。

参照元 rdhmmdef()・rdhmmlist()・tmix_read().

void mybfree2 ( BMALLOC_BASE **  list  ) 

Free all memories allocated by mybmalloc2()

引数:
list [i/o] total memory management information (will be cleaned here)

mybmalloc.c の 280 行で定義されています。

参照元 bt_prepare()・hmminfo_free()・outprob_cache_free()・wchmm_free()・word_info_free().


Julianに対してTue Dec 26 12:58:06 2006に生成されました。  doxygen 1.5.0