53 void gk_AllocMatrix(
void ***r_matrix,
size_t elmlen,
size_t ndim1,
size_t ndim2)
60 if ((matrix = (
void **)
gk_malloc(ndim1*
sizeof(
void *),
"gk_AllocMatrix: matrix")) ==
NULL)
63 for (i=0; i<ndim1; i++) {
64 if ((matrix[i] = (
void *)
gk_malloc(ndim2*elmlen,
"gk_AllocMatrix: matrix[i]")) ==
NULL) {
84 if ((matrix = *r_matrix) ==
NULL)
87 for (i=0; i<ndim1; i++)
147 ptr = (
void *)malloc(nbytes);
152 gk_errexit(
SIGMEM,
"***Memory allocation failed for %s. Requested size: %zu bytes",
162 memset(ptr, 0, nbytes);
182 ptr = (
void *)realloc(oldptr, nbytes);
187 gk_errexit(
SIGMEM,
"***Memory realloc failed for %s. " "Requested size: %zu bytes",
215 va_start(plist, ptr1);
216 while ((ptr = va_arg(plist,
void **)) !=
LTERM) {
void gk_free(void **ptr1,...)
#define GK_MKALLOC(PRFX, TYPE)
void gk_AllocMatrix(void ***r_matrix, size_t elmlen, size_t ndim1, size_t ndim2)
static __thread gk_mcore_t * gkmcore
void gk_errexit(int signum, char *f_str,...)
gk_mcore_t * gk_gkmcoreCreate()
void gk_gkmcoreAdd(gk_mcore_t *mcore, int type, size_t nbytes, void *ptr)
size_t gk_GetCurMemoryUsed()
size_t gk_GetMaxMemoryUsed()
void gk_gkmcoreDestroy(gk_mcore_t **r_mcore, int showstats)
void gk_FreeMatrix(void ***r_matrix, size_t ndim1, size_t ndim2)
void gk_gkmcorePush(gk_mcore_t *mcore)
void * gk_realloc(void *oldptr, size_t nbytes, char *msg)
void gk_gkmcoreDel(gk_mcore_t *mcore, void *ptr)
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
void * gk_malloc(size_t nbytes, char *msg)
void gk_gkmcorePop(gk_mcore_t *mcore)
void gk_malloc_cleanup(int showstats)