All of the following functions throw on error to allocate.
void *fz_malloc(fz_context *ctx, size_t size);
void *fz_calloc(fz_context *ctx, size_t count, size_t size);
These are like malloc
and calloc
, but throw on error to allocate.
fz_malloc_struct(CTX, STRUCT);
macro frontend defined as
fz_calloc(CTX,1,sizeof(STRUCT));
void *fz_malloc_array(fz_context *ctx, size_t count, size_t size);
Like fz_calloc
, but do not zero the allocated memory.
void *fz_resize_array(fz_context *ctx, void *p, size_t count, size_t size);
Resize the existing block p
. Return a pointer to the resized block. If count
or size
is 0
, free p
and return NULL
.
char *fz_strdup(fz_context *ctx, const char *s);
Duplicate a C string.