#include <sent/stddefs.h>
Go to the source code of this file.
Functions | |
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(). | |
Variables | |
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. |
This file defines functions that allocate memories per a certain big block instead of allocating for each required sizes. This function will improve the overhead of memory management operation, especially when an application requires huge number of small segments to be allocated. These functions are mainly used for allocating memory for acoustic models and language models.
Definition in file mybmalloc.c.
void* mybmalloc2 | ( | unsigned 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) |
Definition at line 84 of file mybmalloc.c.
Referenced by add_ac(), add_to_error(), aptree_read(), bt_new(), bt_relocate_rw(), calc_tied_mix_extend(), dens_new(), dens_read(), hmm_add_physical_to_logical(), hmm_add_pseudo_phones_sub(), htk_hmmdata_new(), htk_hmmdata_read(), make_hmm_basephone_list(), mpdf_new(), mpdf_read(), mybstrdup2(), new_node(), outprob_cache_extend(), param_alloc(), rd_data(), rd_dens(), rd_mpdf(), rd_pdf_sub(), rd_state(), rd_streamweight(), rd_tmix(), rd_trans(), rd_var(), rdhmmlist(), rdn_strfunc(), state_new(), state_read(), sw_new(), sw_read(), tmix_create_codebook_index(), tmix_read(), trans_new(), trans_read(), var_new(), var_read(), voca_append(), voca_load_htkdict_line(), voca_load_wordlist_line(), wchmm_add_word(), and 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 |
Definition at line 122 of file mybmalloc.c.
Referenced by rdhmmdef(), rdhmmlist(), and tmix_read().
void mybfree2 | ( | BMALLOC_BASE ** | list | ) |
Free all memories allocated by mybmalloc2().
list | [i/o] total memory management information (will be cleaned here) |
Definition at line 138 of file mybmalloc.c.
Referenced by bt_free(), bt_prepare(), calc_tied_mix_free(), free_cdset(), hmminfo_free(), outprob_cache_free(), param_free_content(), wchmm_free(), and word_info_free().