ACE_Obstack_T< ACE_CHAR_T > Class Template Reference
Define a simple "mark and release" memory allocation utility.
More...
#include <Obstack_T.h>
List of all members.
Detailed Description
template<class ACE_CHAR_T>
class ACE_Obstack_T< ACE_CHAR_T >
Define a simple "mark and release" memory allocation utility.
The implementation is similar to the GNU obstack utility, which is used extensively in the GCC compiler.
Constructor & Destructor Documentation
template<class ACE_CHAR_T >
template<class ACE_CHAR_T >
Member Function Documentation
template<class ACE_CHAR_T>
ACE_CHAR_T * ACE_Obstack_T< ACE_CHAR_T >::copy |
( |
const ACE_CHAR_T * |
data, |
|
|
size_t |
len | |
|
) |
| | [inline] |
Copy the data into the current Obchunk and freeze the current block. Return the starting address of the current building block, 0 if error occurs. len specify the string length, not the actually data size.
template<class ACE_CHAR_T >
Dump the state of an object.
template<class ACE_CHAR_T >
ACE_CHAR_T * ACE_Obstack_T< ACE_CHAR_T >::freeze |
( |
void |
|
) |
[inline] |
Freeze the current building block by null terminating it. Return the starting address of the current building block, 0 if error occurs.
template<class ACE_CHAR_T>
ACE_CHAR_T * ACE_Obstack_T< ACE_CHAR_T >::grow |
( |
ACE_CHAR_T |
c |
) |
[inline] |
Inserting a new ACE_CHAR_T c into the current building block without freezing (null terminating) the block. This function will create new chunk by checking the boundary of current Obchunk. Return the location c gets inserted to, or 0 if error.
template<class ACE_CHAR_T>
void ACE_Obstack_T< ACE_CHAR_T >::grow_fast |
( |
ACE_CHAR_T |
c |
) |
[inline] |
Inserting a new ACE_CHAR_T c into the current building block without freezing (null terminating) the block and without checking for out-of-bound error.
template<class ACE_CHAR_T >
size_t ACE_Obstack_T< ACE_CHAR_T >::length |
( |
void |
|
) |
const [inline] |
Return the maximum length or size of a string that can be put into this Obstack. size = length * sizeof (ACE_CHAR_T).
- Deprecated:
- No need to use this function as you can put objects of arbitrary lengths into the obstack now.
template<class ACE_CHAR_T >
template<class ACE_CHAR_T >
"Release" the entire stack of Obchunks, putting it back on the free list.
template<class ACE_CHAR_T >
Request Obstack to prepare a block at least len long for building a new string. Return -1 if fail, 0 if success.
template<class ACE_CHAR_T >
template<class ACE_CHAR_T >
"Unwind" the stack. If obj is a null pointer, everything allocated in the stack is released. Otherwise, obj must be an address of an object allocated in the stack. In this case, obj is released along with everthing allocated in the Obstack since obj.
template<class ACE_CHAR_T >
void ACE_Obstack_T< ACE_CHAR_T >::unwind_i |
( |
void * |
obj |
) |
[inline, protected] |
Search through the list of Obchunks and release them. Helper funtion used by unwind.
Member Data Documentation
template<class ACE_CHAR_T>
Declare the dynamic allocation hooks.
template<class ACE_CHAR_T>
Pointer to the allocator used by this Obstack.
template<class ACE_CHAR_T>
Pointer to the current Obchunk.
template<class ACE_CHAR_T>
Head of the Obchunk chain.
template<class ACE_CHAR_T>
Current size of the Obstack;.
The documentation for this class was generated from the following files: