cbmimage
Loading...
Searching...
No Matches
Allocation functions (internal)

Functions

static void * cbmimage_ii_xalloc (size_t size)
 
static void cbmimage_ii_xfree (void *ptr)
 
static void * cbmimage_ii_xalloc_and_copy (size_t newsize, const void *oldbuffer, size_t oldsize)
 
void * cbmimage_i_xalloc (size_t size)
 
void cbmimage_i_xfree (void *ptr)
 
void * cbmimage_i_xalloc_and_copy (size_t newsize, const void *oldbuffer, size_t oldsize)
 

Variables

static cbmimage_alloc_xalloc_function_typecbmimage_i_alloc_xalloc_function = cbmimage_ii_xalloc
 pointer to the callback function for cbmimage_i_xalloc()
 
static cbmimage_alloc_xalloc_and_copy_function_typecbmimage_i_alloc_xalloc_and_copy_function = cbmimage_ii_xalloc_and_copy
 pointer to the callback function for cbmimage_i_xalloc_and_copy()
 
static cbmimage_alloc_xfree_function_typecbmimage_i_alloc_xfree_function = cbmimage_ii_xfree
 pointer to the callback function for cbmimage_i_xfree()
 

Detailed Description

Function Documentation

◆ cbmimage_i_xalloc()

void * cbmimage_i_xalloc ( size_t size)

allocate dynamic memory

The dynamic memory is initialized with 0.

Parameters
[in]sizesize of the block to be allocated
Returns
a pointer to the memory block, or 0 if the allocation failed
Remarks

◆ cbmimage_i_xalloc_and_copy()

void * cbmimage_i_xalloc_and_copy ( size_t newsize,
const void * oldbuffer,
size_t oldsize )

allocate dynamic memory and copy into it

Allocates memory like cbmimage_i_xalloc(), but initializes the memory by copying from another buffer into it

Parameters
[in]newsizesize of the block to be allocated
[in]oldbufferptr to a buffer from which to copy
[in]oldsizethe size of the data in the oldbuffer
Returns
a pointer to the memory block, or 0 if the allocation failed
Remarks

◆ cbmimage_i_xfree()

void cbmimage_i_xfree ( void * ptr)

free dynamic memory

The dynamic memory is initialized with 0.

Parameters
[in]ptrptr to a block that was allocated by cbmimage_i_xalloc()

◆ cbmimage_ii_xalloc()

static void * cbmimage_ii_xalloc ( size_t size)
static

allocate dynamic memory, internal implementation

The dynamic memory is initialized with 0.

Parameters
[in]sizesize of the block to be allocated
Returns
a pointer to the memory block, or 0 if the allocation failed
Remarks

◆ cbmimage_ii_xalloc_and_copy()

static void * cbmimage_ii_xalloc_and_copy ( size_t newsize,
const void * oldbuffer,
size_t oldsize )
static

allocate dynamic memory and copy into it, internal implementation

Allocates memory like cbmimage_i_xalloc(), but initializes the memory by copying from another buffer into it

Parameters
[in]newsizesize of the block to be allocated
[in]oldbufferptr to a buffer from which to copy
[in]oldsizethe size of the data in the oldbuffer
Returns
a pointer to the memory block, or 0 if the allocation failed
Remarks

◆ cbmimage_ii_xfree()

static void cbmimage_ii_xfree ( void * ptr)
static

free dynamic memory, internal implementation

Parameters
[in]ptrptr to a block that was allocated by cbmimage_i_xalloc()

Variable Documentation

◆ cbmimage_i_alloc_xalloc_and_copy_function

cbmimage_alloc_xalloc_and_copy_function_type* cbmimage_i_alloc_xalloc_and_copy_function = cbmimage_ii_xalloc_and_copy
static

pointer to the callback function for cbmimage_i_xalloc_and_copy()

Remarks
  • If this is set to NULL, then the internal variant is used
  • For a discussion if this function can be NULL or not, cf. the remarks at cbmimage_alloc_set_functions()

◆ cbmimage_i_alloc_xalloc_function

cbmimage_alloc_xalloc_function_type* cbmimage_i_alloc_xalloc_function = cbmimage_ii_xalloc
static

pointer to the callback function for cbmimage_i_xalloc()

Remarks
  • If this is set to NULL, then the internal variant is used
  • For a discussion if this function can be NULL or not, cf. the remarks at cbmimage_alloc_set_functions()

◆ cbmimage_i_alloc_xfree_function

cbmimage_alloc_xfree_function_type* cbmimage_i_alloc_xfree_function = cbmimage_ii_xfree
static

pointer to the callback function for cbmimage_i_xfree()

Remarks
  • If this is set to NULL, then the internal variant is used
  • For a discussion if this function can be NULL or not, cf. the remarks at cbmimage_alloc_set_functions()