Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module tango.util.container.mgmt.GCAllocator;
- public import tango.util.container.mgmt.Allocator;
- /*******************************************************************************
- Generic GC allocations
- *******************************************************************************/
- class GCAllocator(T) : Allocator!(T)
- {
- /***********************************************************************
- allocate a fixed-size (T) chunk of memory
- ***********************************************************************/
- final override void[] allocate ()
- {
- return allocate (T.sizeof);
- }
- /***********************************************************************
- allocate an arbitrary chunk of memory
- ***********************************************************************/
- final override void[] allocate (uint size)
- {
- return new void[size];
- }
- /***********************************************************************
- Invoked during a client .dup to clone an attached allocator
- ***********************************************************************/
- final override GCAllocator factory ()
- {
- return this;
- }
- /***********************************************************************
- Invoked when clear/reset is called on the host. Parameter
- all indicated whether all memory usage should be collected
- or just the fixed-size blocks
- ***********************************************************************/
- final override void collect (bool all)
- {
- }
- }
Add Comment
Please, Sign In to add comment