Go to the documentation of this file.
78 #include <jasper/jas_config.h>
150 #if defined(JAS_FOR_INTERNAL_USE_ONLY)
172 #if defined(JAS_THREADS)
177 } jas_basic_allocator_t;
184 #if defined(JAS_FOR_INTERNAL_USE_ONLY)
187 extern jas_basic_allocator_t jas_basic_allocator;
236 void *
jas_calloc(
size_t num_elements,
size_t element_size);
243 void *
jas_alloc2(
size_t num_elements,
size_t element_size);
250 void *
jas_alloc3(
size_t num_arrays,
size_t array_size,
size_t element_size);
257 void *
jas_realloc2(
void *ptr,
size_t num_elements,
size_t element_size);
326 #if defined(JAS_FOR_INTERNAL_USE_ONLY)
332 void jas_basic_allocator_init(jas_basic_allocator_t *allocator,
void *(* alloc)(struct jas_allocator_s *allocator, size_t size)
Definition: jas_malloc.h:115
JAS_EXPORT int jas_logwarnf(const char *fmt,...)
Generate a warning log message.
Definition: jas_debug.c:131
void * jas_alloc3(size_t num_arrays, size_t array_size, size_t element_size)
Allocate array of arrays (with overflow checking).
Definition: jas_malloc.c:221
JAS_EXPORT void jas_std_allocator_init(jas_std_allocator_t *allocator)
Initialize a memory allocator that uses malloc and related functions for managing memory.
Definition: jas_malloc.c:262
JAS_EXPORT void jas_allocator_cleanup(jas_allocator_t *allocator)
Clean up an allocator that is no longer needed.
Definition: jas_malloc.c:244
JAS_EXPORT int jas_logerrorf(const char *fmt,...)
Generate an error log message.
Definition: jas_debug.c:119
void(* cleanup)(struct jas_allocator_s *allocator)
Definition: jas_malloc.h:109
The standard library allocator (i.e., a wrapper for malloc and friends).
Definition: jas_malloc.h:143
void * jas_realloc2(void *ptr, size_t num_elements, size_t element_size)
Resize a block of allocated memory (with overflow checking).
Definition: jas_malloc.c:231
size_t jas_get_total_mem_size()
Get the total amount of memory available on the system.
Definition: jas_malloc.c:627
void * jas_alloc2(size_t num_elements, size_t element_size)
Allocate array (with overflow checking).
Definition: jas_malloc.c:212
void jas_set_max_mem_usage(size_t max_mem)
Set the maximum memory usage allowed by the allocator wrapper.
Definition: jas_malloc.c:355
size_t jas_get_mem_usage()
Get the current memory usage from the allocator wrapper.
Definition: jas_malloc.c:370
void(* free)(struct jas_allocator_s *allocator, void *pointer)
Definition: jas_malloc.h:121
JAS_EXPORT void * jas_realloc(void *ptr, size_t size)
Resize a block of allocated memory.
Definition: jas_malloc.c:151
void * jas_calloc(size_t num_elements, size_t element_size)
Allocate a block of memory and initialize the contents to zero.
Definition: jas_malloc.c:198
JAS_EXPORT void * jas_malloc(size_t size)
Allocate memory.
Definition: jas_malloc.c:136
JasPer Debugging-Related Functionality.
JAS_EXPORT void jas_free(void *ptr)
Free memory.
Definition: jas_malloc.c:186
void *(* realloc)(struct jas_allocator_s *allocator, void *pointer, size_t new_size)
Definition: jas_malloc.h:127
struct jas_allocator_s jas_allocator_t
A memory allocator.
A memory allocator.
Definition: jas_malloc.h:101