Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Member Functions | List of all members
CoreScratchpadMemory Class Reference

Efficient non thread-safe basic allocator. Typically use as a temporary scratchpad. More...

Inheritance diagram for CoreScratchpadMemory:
CtxGasTraversal CtxScratchpad

Public Member Functions

 CoreScratchpadMemory (const size_t &default_page_size)
 Memory scratchpad constructor.
 
virtual ~CoreScratchpadMemory ()
 mMemory scratchpad destructor. Will call every allocated objects destructor.
 
template<class T >
T * new_object (const unsigned int &count=1)
 Returns a handle on the allocated data. The constructor of the class is called for each newly created object, and the destructor will be called when deleting the scratchpad, or reseting it.
 
template<class T >
T * alloc_data (const unsigned int &count=1)
 Returns a handle on the allocated raw data. No constructor or destructor call.
 
void reset ()
 Reset the memory scratchpad, calling every registered destructors on allocated data.
 
const unsigned int & get_page_count () const
 Get the current number of allocated pages.
 
const unsigned int & get_resize_count () const
 Get the number of times a page has been resized.
 

Detailed Description

Efficient non thread-safe basic allocator. Typically use as a temporary scratchpad.

Member Function Documentation

template<class T >
T * CoreScratchpadMemory::alloc_data ( const unsigned int &  count = 1)
inline

Returns a handle on the allocated raw data. No constructor or destructor call.

Parameters
[in]countThe number of object to create.
const unsigned int& CoreScratchpadMemory::get_resize_count ( ) const
inline

Get the number of times a page has been resized.

Note
Not sure what this is actually used for...
template<class T >
T * CoreScratchpadMemory::new_object ( const unsigned int &  count = 1)
inline

Returns a handle on the allocated data. The constructor of the class is called for each newly created object, and the destructor will be called when deleting the scratchpad, or reseting it.

Parameters
[in]countThe number of object to create.