Go to the source code of this file.
Functions | |
gk_mcore_t * | gk_mcoreCreate (size_t coresize) |
gk_mcore_t * | gk_gkmcoreCreate () |
void | gk_mcoreDestroy (gk_mcore_t **r_mcore, int showstats) |
void | gk_gkmcoreDestroy (gk_mcore_t **r_mcore, int showstats) |
void * | gk_mcoreMalloc (gk_mcore_t *mcore, size_t nbytes) |
void | gk_mcorePush (gk_mcore_t *mcore) |
void | gk_gkmcorePush (gk_mcore_t *mcore) |
void | gk_mcorePop (gk_mcore_t *mcore) |
void | gk_gkmcorePop (gk_mcore_t *mcore) |
void | gk_mcoreAdd (gk_mcore_t *mcore, int type, size_t nbytes, void *ptr) |
void | gk_gkmcoreAdd (gk_mcore_t *mcore, int type, size_t nbytes, void *ptr) |
void | gk_mcoreDel (gk_mcore_t *mcore, void *ptr) |
void | gk_gkmcoreDel (gk_mcore_t *mcore, void *ptr) |
Definition in file mcore.c.
gk_mcore_t* gk_mcoreCreate | ( | size_t | coresize | ) |
This function creates an mcore
Definition at line 18 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::core, gk_mcore_t::corecpos, gk_mcore_t::coresize, gk_malloc(), gk_mcore_t::mops, and gk_mcore_t::nmops.
Referenced by AllocateWorkSpace().
gk_mcore_t* gk_gkmcoreCreate | ( | ) |
This function creates an mcore. This version is used for gkmcore.
Definition at line 43 of file mcore.c.
References gk_mcore_t::cmop, free(), malloc(), gk_mcore_t::mops, and gk_mcore_t::nmops.
Referenced by gk_malloc_init().
void gk_mcoreDestroy | ( | gk_mcore_t ** | r_mcore, | |
int | showstats | |||
) |
This function destroys an mcore.
Definition at line 67 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::core, gk_mcore_t::coresize, gk_mcore_t::cur_callocs, gk_mcore_t::cur_hallocs, gk_free(), gk_mcore_t::max_callocs, gk_mcore_t::max_hallocs, gk_mcore_t::mops, gk_mcore_t::nmops, gk_mcore_t::num_callocs, gk_mcore_t::num_hallocs, gk_mcore_t::size_callocs, and gk_mcore_t::size_hallocs.
Referenced by FreeWorkSpace().
void gk_gkmcoreDestroy | ( | gk_mcore_t ** | r_mcore, | |
int | showstats | |||
) |
This function destroys an mcore. This version is for gkmcore.
Definition at line 103 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::cur_hallocs, free(), gk_mcore_t::max_hallocs, gk_mcore_t::mops, gk_mcore_t::nmops, gk_mcore_t::num_hallocs, and gk_mcore_t::size_hallocs.
Referenced by gk_malloc_cleanup().
void* gk_mcoreMalloc | ( | gk_mcore_t * | mcore, | |
size_t | nbytes | |||
) |
This function allocate space from the core/heap
Definition at line 140 of file mcore.c.
References gk_mcore_t::core, gk_mcore_t::corecpos, gk_malloc(), and gk_mcoreAdd().
Referenced by wspacemalloc().
void gk_mcorePush | ( | gk_mcore_t * | mcore | ) |
This function sets a marker in the stack of malloc ops to be used subsequently for freeing purposes
Definition at line 175 of file mcore.c.
References gk_mcoreAdd().
Referenced by wspacepush().
void gk_gkmcorePush | ( | gk_mcore_t * | mcore | ) |
This function sets a marker in the stack of malloc ops to be used subsequently for freeing purposes. This is the gkmcore version.
Definition at line 187 of file mcore.c.
References gk_gkmcoreAdd().
Referenced by gk_malloc_init().
void gk_mcorePop | ( | gk_mcore_t * | mcore | ) |
This function frees all mops since the last push
Definition at line 198 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::corecpos, gk_mcore_t::coresize, gk_mcore_t::cur_callocs, gk_mcore_t::cur_hallocs, errexit(), gk_errexit(), gk_free(), gk_mcore_t::mops, gk_mop_t::nbytes, gk_mop_t::ptr, and gk_mop_t::type.
Referenced by wspacepop().
void gk_gkmcorePop | ( | gk_mcore_t * | mcore | ) |
This function frees all mops since the last push. This version is for poping the gkmcore and it uses free instead of gk_free.
Definition at line 237 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::cur_hallocs, free(), gk_errexit(), gk_mcore_t::mops, gk_mop_t::nbytes, gk_mop_t::ptr, and gk_mop_t::type.
Referenced by gk_malloc_cleanup().
void gk_mcoreAdd | ( | gk_mcore_t * | mcore, | |
int | type, | |||
size_t | nbytes, | |||
void * | ptr | |||
) |
Adds a memory allocation at the end of the list.
Definition at line 265 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::cur_callocs, gk_mcore_t::cur_hallocs, gk_errexit(), gk_mcore_t::max_callocs, gk_mcore_t::max_hallocs, gk_mcore_t::mops, gk_mop_t::nbytes, gk_mcore_t::nmops, gk_mcore_t::num_callocs, gk_mcore_t::num_hallocs, gk_mop_t::ptr, realloc(), gk_mcore_t::size_callocs, gk_mcore_t::size_hallocs, and gk_mop_t::type.
Referenced by gk_mcoreMalloc(), and gk_mcorePush().
void gk_gkmcoreAdd | ( | gk_mcore_t * | mcore, | |
int | type, | |||
size_t | nbytes, | |||
void * | ptr | |||
) |
Adds a memory allocation at the end of the list. This is the gkmcore version.
Definition at line 309 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::cur_hallocs, gk_errexit(), gk_mcore_t::max_hallocs, gk_mcore_t::mops, gk_mop_t::nbytes, gk_mcore_t::nmops, gk_mcore_t::num_hallocs, gk_mop_t::ptr, realloc(), gk_mcore_t::size_hallocs, and gk_mop_t::type.
Referenced by gk_gkmcorePush(), gk_malloc(), and gk_realloc().
void gk_mcoreDel | ( | gk_mcore_t * | mcore, | |
void * | ptr | |||
) |
This function deletes the mop associated with the supplied pointer. The mop has to be a heap allocation, otherwise it fails violently.
Definition at line 345 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::cur_hallocs, gk_errexit(), gk_mcore_t::mops, gk_mop_t::nbytes, gk_mop_t::ptr, and gk_mop_t::type.
void gk_gkmcoreDel | ( | gk_mcore_t * | mcore, | |
void * | ptr | |||
) |
This function deletes the mop associated with the supplied pointer. The mop has to be a heap allocation, otherwise it fails violently. This is the gkmcore version.
Definition at line 373 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::cur_hallocs, gk_errexit(), gk_mcore_t::mops, gk_mop_t::nbytes, gk_mop_t::ptr, and gk_mop_t::type.
Referenced by gk_free(), and gk_realloc().