JasPer  4.1.1
jas_malloc.h File Reference

JasPer Memory Allocator. More...

#include <jasper/jas_config.h>
#include <jasper/jas_types.h>
#include <jasper/jas_thread.h>
#include <stdio.h>

Go to the source code of this file.

Classes

struct  jas_allocator_s
 A memory allocator. More...
 
struct  jas_std_allocator_t
 The standard library allocator (i.e., a wrapper for malloc and friends). More...
 

Typedefs

typedef struct jas_allocator_s jas_allocator_t
 A memory allocator. More...
 

Functions

JAS_EXPORT void * jas_malloc (size_t size)
 Allocate memory. More...
 
JAS_EXPORT void jas_free (void *ptr)
 Free memory. More...
 
JAS_EXPORT void * jas_realloc (void *ptr, size_t size)
 Resize a block of allocated memory. More...
 
JAS_EXPORT void * jas_calloc (size_t num_elements, size_t element_size)
 Allocate a block of memory and initialize the contents to zero. More...
 
JAS_EXPORT void * jas_alloc2 (size_t num_elements, size_t element_size)
 Allocate array (with overflow checking). More...
 
JAS_EXPORT void * jas_alloc3 (size_t num_arrays, size_t array_size, size_t element_size)
 Allocate array of arrays (with overflow checking). More...
 
JAS_EXPORT void * jas_realloc2 (void *ptr, size_t num_elements, size_t element_size)
 Resize a block of allocated memory (with overflow checking). More...
 
JAS_EXPORT void jas_set_max_mem_usage (size_t max_mem)
 Set the maximum memory usage allowed by the allocator wrapper. More...
 
JAS_EXPORT size_t jas_get_mem_usage (void)
 Get the current memory usage from the allocator wrapper. More...
 
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. More...
 
JAS_EXPORT void jas_allocator_cleanup (jas_allocator_t *allocator)
 Clean up an allocator that is no longer needed. More...
 
JAS_EXPORT size_t jas_get_total_mem_size (void)
 Get the total amount of memory available on the system. More...
 

Detailed Description

JasPer Memory Allocator.