#include <cassert>
Go to the source code of this file.
|
template<class T > |
T * | xNew (unsigned int size) |
|
template<class T > |
T ** | xNew (unsigned int dim1, unsigned int dim2) |
|
template<class T > |
T * | xNewZeroInit (unsigned int size) |
|
template<class T > |
T ** | xNewZeroInit (unsigned int dim1, unsigned int dim2) |
|
template<class T > |
void | xDelete (T **&aT_pp) |
|
template<class T > |
void | xDelete (T *&aT_p) |
|
template<class T > |
T * | xReNew (T *old, unsigned int old_size, unsigned int size) |
|
template<class T > |
T * | xMemCpy (T *dest, const T *src, unsigned int size) |
|
◆ USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
#define USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES |
◆ xNew() [1/2]
template<class T >
T* xNew |
( |
unsigned int |
size | ) |
|
Definition at line 24 of file MemOps.h.
26 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
31 T* aT_p=(T*)malloc(size*
sizeof(T));
◆ xNew() [2/2]
template<class T >
T** xNew |
( |
unsigned int |
dim1, |
|
|
unsigned int |
dim2 |
|
) |
| |
Definition at line 36 of file MemOps.h.
37 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
38 T* buf=xNew<T>(dim1*dim2);
39 T** aT_pp =
new T*[dim1];
41 for (
unsigned int i=0;i<dim1;++i) {
47 T* buf=(T*)malloc(dim1*dim2*
sizeof(T));
49 T** aT_pp =(T**)malloc(dim1*
sizeof(T*));
51 for (
unsigned int i=0;i<dim1;++i) {
◆ xNewZeroInit() [1/2]
template<class T >
T* xNewZeroInit |
( |
unsigned int |
size | ) |
|
Definition at line 62 of file MemOps.h.
64 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
66 T* aT_p=xNew<T>(size,contig);
68 T* aT_p=xNew<T>(size);
70 for (
unsigned int i=0; i<size;++i)
74 T* aT_p=(T*)calloc(size,
sizeof(T));
◆ xNewZeroInit() [2/2]
template<class T >
T** xNewZeroInit |
( |
unsigned int |
dim1, |
|
|
unsigned int |
dim2 |
|
) |
| |
Definition at line 79 of file MemOps.h.
80 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
81 T** aT_pp=xNew<T>(dim1,dim2);
82 for (
unsigned int i=0; i<dim1*dim2;++i)
86 T* buf=(T*)calloc(dim1*dim2*
sizeof(T));
88 T** aT_pp =(T**)malloc(dim1*
sizeof(T*));
90 for (
unsigned int i=0;i<dim1;++i) {
◆ xDelete() [1/2]
template<class T >
void xDelete |
( |
T **& |
aT_pp | ) |
|
Definition at line 97 of file MemOps.h.
99 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
◆ xDelete() [2/2]
template<class T >
void xDelete |
( |
T *& |
aT_p | ) |
|
Definition at line 109 of file MemOps.h.
111 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
◆ xReNew()
template<class T >
T* xReNew |
( |
T * |
old, |
|
|
unsigned int |
old_size, |
|
|
unsigned int |
size |
|
) |
| |
Definition at line 118 of file MemOps.h.
119 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
135 unsigned int iMax=(old_size<size)?old_size:size;
136 for (
unsigned int i=0; i<iMax;++i) {
146 aT_p=(T*)realloc((
void*)old,size*
sizeof(T));
◆ xMemCpy()
template<class T >
T* xMemCpy |
( |
T * |
dest, |
|
|
const T * |
src, |
|
|
unsigned int |
size |
|
) |
| |
Definition at line 152 of file MemOps.h.
153 assert(dest); assert(src);
154 for (
int i=0; i<size;++i)
◆ DEFCONTIG
char const DEFCONTIG = 'f' |
|
static |