Trees | Indices | Toggle frames |
---|
__init__(self,
capacity)
Create an allocator for a buffer of the specified capacity.
|
|
set_capacity(self,
size)
Resize the maximum buffer size.
|
|
int |
alloc(self,
size)
Allocate memory in the buffer.
|
realloc(self,
start,
size,
new_size)
Reallocate a region of the buffer.
|
|
dealloc(self,
start,
size)
Free a region of the buffer.
|
|
(list, list) |
get_allocated_regions(self)
Get a list of (aggregate) allocated regions.
|
int |
get_fragmented_free_size(self)
Returns the amount of space unused, not including the final
free block.
|
int |
get_free_size(self)
Return the amount of space unused.
|
float |
get_usage(self)
Return fraction of capacity currently allocated.
|
float |
get_fragmentation(self)
Return fraction of free space that is not expandable.
|
__str__(self) | |
__repr__(self) |
Resize the maximum buffer size.
The capacity cannot be reduced.
Allocate memory in the buffer.
Raises AllocatorMemoryException if the allocation cannot be fulfilled.
Reallocate a region of the buffer.
This is more efficient than separate dealloc and alloc calls, as the region can often be resized in-place.
Raises AllocatorMemoryException if the allocation cannot be fulfilled.
Get a list of (aggregate) allocated regions.
The result of this method is (starts, sizes), where starts is a list of starting indices of the regions and sizes their corresponding lengths.
Trees | Indices | Toggle frames |
---|
Generated by Epydoc 3.0beta1 on Thu Dec 31 17:58:18 2009 | http://epydoc.sourceforge.net |