Julius 4.2
関数 | 変数
libsent/src/util/mybmalloc.c

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

#include <sent/stddefs.h>

ソースコードを見る。

関数

static void mybmalloc_set_param ()
 Set block size and memory alignment factor.
void * mybmalloc2 (unsigned int size, BMALLOC_BASE **list)
 Another version of memory block allocation, used for tree lexicon.
char * mybstrdup2 (char *s, BMALLOC_BASE **list)
 String duplication using mybmalloc2().
void mybfree2 (BMALLOC_BASE **list)
 Free all memories allocated by mybmalloc2()

変数

static boolean mybmalloc_initialized = FALSE
 TRUE if mybmalloc has already initialized.
static unsigned int pagesize
 Page size for memoly allocation.
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.

説明

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

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

作者:
Akinobu LEE
日付:
Thu Feb 17 16:14:59 2005
Revision:
1.4

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


関数

void* mybmalloc2 ( unsigned int  size,
BMALLOC_BASE **  list 
)
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.c122 行で定義されています。

参照元 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.c138 行で定義されています。

参照元 bt_free(), bt_prepare(), calc_tied_mix_free(), free_cdset(), hmminfo_free(), ngram_info_free(), outprob_cache_free(), param_free_content(), wchmm_free(), と word_info_free().