ARB
Namespaces | Functions
arb_mem.h File Reference
#include <cstdlib>
#include <cstring>
#include <attributes.h>
Include dependency graph for arb_mem.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 arb_mem
 

Functions

void arb_mem::failed_to_allocate (const char *reason) __ATTR__NORETURN
 
void arb_mem::failed_to_allocate (size_t nelem, size_t elsize) __ATTR__NORETURN
 
void arb_mem::failed_to_allocate (size_t size) __ATTR__NORETURN
 
void arb_mem::alloc_aligned (void **tgt, size_t alignment, size_t len)
 
template<class TYPE >
void ARB_alloc_aligned (TYPE *&tgt, size_t nelems)
 
template<class TYPE >
void ARB_realloc (TYPE *&tgt, size_t nelem)
 
template<class TYPE >
void ARB_recalloc (TYPE *&tgt, size_t oelem, size_t nelem)
 
template<class TYPE >
TYPEARB_alloc (size_t nelem)
 
template<class TYPE >
void ARB_alloc (TYPE *&tgt, size_t nelem)
 
template<class TYPE >
TYPEARB_calloc (size_t nelem)
 
template<class TYPE >
void ARB_calloc (TYPE *&tgt, size_t nelem)
 

Function Documentation

template<class TYPE >
void ARB_alloc_aligned ( TYPE *&  tgt,
size_t  nelems 
)
inline

allocate 16 byte aligned memory (terminate on failure)

Definition at line 37 of file arb_mem.h.

References arb_mem::alloc_aligned().

Referenced by AP_weights::AP_weights().

template<class TYPE >
void ARB_realloc ( TYPE *&  tgt,
size_t  nelem 
)
inline
template<class TYPE >
void ARB_recalloc ( TYPE *&  tgt,
size_t  oelem,
size_t  nelem 
)
inline

reallocate memoryblock to fit 'nelem' entries (partially cleared if 'oelem<nelem'; terminate on failure)

Definition at line 49 of file arb_mem.h.

References ARB_realloc().

Referenced by AW_GC_set::add_gc(), gb_local_data::announce_db_open(), ED4_create_sequences_for_gde(), gb_create_key_array(), ParseMenus(), ReadGen(), set_and_realloc_gde_array(), and CharPtrArray::set_space().

template<class TYPE >
TYPE* ARB_alloc ( size_t  nelem)
inline
template<class TYPE >
void ARB_alloc ( TYPE *&  tgt,
size_t  nelem 
)
inline

malloc memory for an array of 'nelem' instances of TYPE and assign its address to 'tgt' (terminates on failure).

1 int *p;
2 ARB_alloc(p, 7); // allocates space for 7 int
See also
ARB_alloc<TYPE>

Definition at line 69 of file arb_mem.h.

template<class TYPE >
TYPE* ARB_calloc ( size_t  nelem)
inline
template<class TYPE >
void ARB_calloc ( TYPE *&  tgt,
size_t  nelem 
)
inline

calloc memory for an array of 'nelem' instances of TYPE and assign its address to 'tgt' (terminates on failure).

1 int *p;
2 ARB_calloc(p, 7); // allocates space for 7 int (initializes memory with 0)
See also
ARB_calloc<TYPE>

Definition at line 94 of file arb_mem.h.