implements a simple approach to support frequent allocation and deallocation of arrays of the same sizes.
More...
|
template<class T > |
int | CH_Matrix_Classes::mem_provide (Memarray &memarray, long provide, long in_use, long &avail, T *&store) |
| provide sufficient memory for an existing array, reallocating and copying the old information upon need, returns 0 upon success, !=0 upon failure. More...
|
|
template<class T > |
int | CH_Matrix_Classes::mem_provide_init0 (Memarray &memarray, long provide, long &avail, T *&store) |
| provide sufficient memory for an existing array, reallocating and copying the old information and initializing the new entries to 0, returns 0 upon success, !=0 upon failure. More...
|
|
implements a simple approach to support frequent allocation and deallocation of arrays of the same sizes.
◆ mem_provide()
template<class T >
int CH_Matrix_Classes::mem_provide |
( |
Memarray & |
memarray, |
|
|
long |
provide, |
|
|
long |
in_use, |
|
|
long & |
avail, |
|
|
T *& |
store |
|
) |
| |
|
inline |
provide sufficient memory for an existing array, reallocating and copying the old information upon need, returns 0 upon success, !=0 upon failure.
- Parameters
-
memarray | the Memory Manger which provided the address in store |
provide | the minimum number of entries needed |
in_use | the number of entries currently in use |
avail | the number of entries currently available and available afterwards |
store | the current address and the ouput address of the starting element |
References CH_Matrix_Classes::Memarray::free(), CH_Matrix_Classes::Memarray::get(), and CH_Matrix_Classes::Memarray::in_use.
◆ mem_provide_init0()
template<class T >
int CH_Matrix_Classes::mem_provide_init0 |
( |
Memarray & |
memarray, |
|
|
long |
provide, |
|
|
long & |
avail, |
|
|
T *& |
store |
|
) |
| |
|
inline |
provide sufficient memory for an existing array, reallocating and copying the old information and initializing the new entries to 0, returns 0 upon success, !=0 upon failure.
- Parameters
-
memarray | the Memory Manger which provided the address in store |
provide | the minimum number of entries needed |
avail | the number of entries currently available and available afterwards |
store | the current address and the ouput address of the starting element |
References CH_Matrix_Classes::Memarray::free(), and CH_Matrix_Classes::Memarray::get().