Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TStandardMemoryHeap
Inherited By:
None.
Purpose:
TLocalMemoryHeap is a class that provides a standard heap implementation for use within a single address space.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
Do not derive any classes from TLocalMemoryHeap.
Concurrency:
Multithread safe.
Resource Use:
No special requirements.
Other Considerations:
None.
- TLocalMemoryHeap (size_t maxBytes =0)
- TLocalMemoryHeap (const TLocalMemoryHeap &)
Interface Category:
API.
Purpose:
- Constructs a local heap of the specified size.
- Copy constructor.
Calling Context:
- Called to construct a local heap of the specified size.
- Called to copy an object.
Parameters:
- size_t maxBytes =0 -The initial size of the heap.
- const TLocalMemoryHeap & -The object to be copied.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
A local heap can eventually grow larger than its initial size.
virtual ~ TLocalMemoryHeap ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
The Heap framework makes one distinguished instance the master object, so deleting a nonmaster object does not delete the heap itself.
TLocalMemoryHeap & operator =(const TLocalMemoryHeap &)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
Return Value:
A non-const reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
- void * operator new (size_t size, char * where)
- void * operator new (size_t size)
- void * operator new (size_t size, TMemoryHeap & whichHeap)
- void * operator new (size_t size, const TAllocationHeap & whichHeap)
Interface Category:
API.
Purpose:
- Allocates a TLocalMemoryHeap, specifying the storage location.
- Allocates a TLocalMemoryHeap into the default heap.
- Allocates a TLocalMemoryHeap into the specified heap.
- Allocates a TLocalMemoryHeap into the specified allocation heap.
Calling Context:
- Called only by the loader.
- Called by clients of TLocalMemoryHeap.
- Called by clients of TLocalMemoryHeap.
- Called by clients of TLocalMemoryHeap.
Parameters:
- size_t size -The size of the requested block.
- char * where -The location where the block should be allocated.
- size_t size -The size of the requested block.
- size_t size -The size of the requested block.
- TMemoryHeap & whichHeap -The heap in which to allocate.
- size_t size -The size of the requested block.
- const void * block -Allocate in the same heap as the given block.
- const TAllocationHeap & whichHeap -The heap to use.
Return Value:
Returns a pointer to the block.
Exceptions:
Throws no exceptions, passes through exceptions from the various forms of ::operator new.
Concurrency:
Multithread safe.
Other Considerations:
The first form of the new operator is provided to allow the loader bootstrap code to create a TLocalMemoryHeap in static storage.
If a class provides operator new, all global operator new overloads and operator delete must also be provided to allow clients to allocate objects of that class in a heap. Because TLocalMemoryHeap provides a special operator new for the loader, it must also provide the same overloads as the global operator new to allow clients to allocate TLocalMemoryHeaps in heaps.
Member Function: TLocalMemoryHeap::operatordelete
void operator delete (void * block)
Interface Category:
API.
Purpose:
Deletes a TLocalMemoryHeap.
Calling Context:
Called by TLocalMemoryHeap client to delete a TLocalMemoryHeap.
Parameters:
Return Value:
None.
Exceptions:
Passes through exceptions from the global operator delete.
Concurrency:
Multithread safe.
Other Considerations:
Because TLocalMemoryHeap overloads operator new, the delete operator is required to allow clients to delete heap-allocated TLocalMemoryHeap objects.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.