TaPAS  0.2
Macros | Functions
ccl-memory.h File Reference

Memory Allocators. More...

#include <ccl/ccl-common.h>
#include <ccl/ccl-exception.h>

Go to the source code of this file.

Macros

#define ccl_malloc(sz)   ccl_real_malloc(sz)
 Allocates a new uninitialized bloc of size bytes. More...
 
#define ccl_new_array(_type_, _sz_)   ((_type_ *)ccl_calloc (_sz_, sizeof(_type_)))
 Allocates an array of sz elements of type type.
 
#define ccl_new(_type_)   ccl_new_array (_type_, 1)
 Allocates a new block large enough to receive an object of type type
 
#define ccl_delete(_ptr_)   ccl_free (_ptr_)
 Releases the memory pointed by ptr.
 
#define ccl_zdelete(_del, _ptr_)
 Releases the memory pointed by ptr if not NULL.
 
#define ccl_memzero(_p, _size)   ccl_memset (_p, 0, _size)
 Fill the memory block at address _p with _size 0-bytes.
 
#define ccl_memset(_p, _c, _size)   memset (_p, _c, _size)
 Fill the memory block at address _p with _size bytes equal to _c.
 
#define ccl_memcpy(_dst, _src, _size)   memcpy (_dst, _src, _size)
 Copy _size bytes from the address _src to the address _dst.
 
#define ccl_memcmp(_p1, _p2, _size)   memcmp (_p1, _p2, _size)
 Lexicographically compates memory blocks at addresses _p1 and _p2 for at most _size bytes.
 

Functions

 CCL_DECLARE_EXCEPTION (memory_exhausted_exception, runtime_exception)
 Exception raised on free memory exhaustion.
 

Detailed Description

Memory Allocators.

Definition in file ccl-memory.h.

Macro Definition Documentation

#define ccl_malloc (   sz)    ccl_real_malloc(sz)

Allocates a new uninitialized bloc of size bytes.

Parameters
sizethe number of bytes to allocate

Definition at line 59 of file ccl-memory.h.