Template Class Malloc¶
Defined in File Malloc.hh
Class Documentation¶
-
template<typename
T
>
classMechatronix
::
Malloc
¶
-
Allocate memory
Public Functions
-
explicit
Malloc
(string const&)¶
-
malloc object constructor
-
~Malloc
()¶
-
malloc object destructor
-
void
allocate
(size_t n, char const *who)¶
-
allocate memory for
n
objects
-
void
reallocate
(size_t n, char const *who)¶
-
allocate memory for
n
objects
-
void
hard_free
(void)¶
-
free allocated memory
free memory
-
inline void
free
(void)¶
-
free memory
-
inline size_t
size
(void) const¶
-
number of objects allocated
-
inline T *
operator()
(size_t sz)¶
-
get the pointer of the preallocated elements. Update the internal pointer for reflect the use of
sz
elements. If no room forsz
elements is available an error is issued.
-
inline bool
is_empty
() const¶
-
check if memory is completely used
-
void
must_be_empty
() const¶
-
issue an error if memory is not completely used
-
explicit