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