16 return calloc ((
size_t) ds, 1);
23 return realloc (d, (
size_t) ds);
39 if (!alloc_func && !realloc_func)
41 mem = alloc_func ? alloc_func (
sizeof (
ExifMem)) :
42 realloc_func (NULL,
sizeof (
ExifMem));
43 if (!mem)
return NULL;
81 if (!mem)
return NULL;
static void exif_mem_free_func(void *d)
Default memory free function.
void * exif_mem_realloc(ExifMem *mem, void *d, ExifLong ds)
void exif_mem_free(ExifMem *mem, void *d)
ExifMem * exif_mem_new(ExifMemAllocFunc alloc_func, ExifMemReallocFunc realloc_func, ExifMemFreeFunc free_func)
Create a new ExifMem.
void exif_mem_unref(ExifMem *mem)
Unrefcount an ExifMem.
ExifMem * exif_mem_new_default(void)
Create a new ExifMem with default values for your convenience.
static void * exif_mem_realloc_func(void *d, ExifLong ds)
Default memory reallocation function.
void * exif_mem_alloc(ExifMem *mem, ExifLong ds)
static void * exif_mem_alloc_func(ExifLong ds)
Default memory allocation function.
void exif_mem_ref(ExifMem *mem)
Refcount an ExifMem.
Define the ExifMem data type and the associated functions.
void *(* ExifMemReallocFunc)(void *p, ExifLong s)
Should work like realloc()
void(* ExifMemFreeFunc)(void *p)
Free method for ExifMem.
void *(* ExifMemAllocFunc)(ExifLong s)
Should work like calloc()
uint32_t ExifLong
EXIF Unsigned Long data type.
ExifMemAllocFunc alloc_func
ExifMemReallocFunc realloc_func
ExifMemFreeFunc free_func