Previous: , Up: blocks guarded   [Contents][Index]


6.6.2 Guarding memory allocated with realloc

Usage example:

cce_location_t        L[1];
ccmem_clean_handler_t S_H[1];

if (cce_location(L)) {
  cce_run_catch_handlers_raise(L, upper_L);
} else {
  ccmem_block_t  S = ccmem_block_malloc_guarded(L, S_H,
                       ccmem_standard_allocator, 256);

  ...
  S = ccmem_block_realloc_guarded(L, S_H,
        ccmem_standard_allocator, S, 512);
  ...
  cce_run_body_handlers(L);
}
Function: ccmem_block_t ccmem_block_realloc_guarded_clean (cce_destination_t L, ccmem_clean_handler_t * S_H, ccmem_allocator_t const * A, ccmem_block_t S, size_t newlen)

Adapter for ccmem_realloc_guarded_clean() that builds and returns a new block representing the reallocation of S. The given handler must be the same handler used in a previous call to the allocation function.

Function: ccmem_block_t ccmem_block_realloc_guarded_error (cce_destination_t L, ccmem_error_handler_t * S_H, ccmem_allocator_t const * A, ccmem_block_t S, size_t newlen)

Adapter for ccmem_realloc_guarded_error() that builds and returns a new block string representing the reallocation of S. The given handler must be the same handler used in a previous call to the allocation function.

Preprocessor Macro: ccmem_block_t ccmem_block_realloc_guarded (cce_destination_t L, S_H, ccmem_allocator_t const * A, ccmem_block_t S, size_t newlen)

Preprocessor macro that builds and returns a new block string representing the reallocation of S. The given handler must be the same handler used in a previous call to the allocation function. If the argument S_H is a pointer to:

ccmem_clean_handler_t

The macro use expands into a call to ccmem_block_realloc_guarded_clean().

ccmem_error_handler_t

The macro use expands into a call to ccmem_block_realloc_guarded_error().


Previous: , Up: blocks guarded   [Contents][Index]

This document describes version 0.2.2-devel.3 of CCMemory.