|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HeapAllocator
The HeapAllocator manages the SaM heap
Nested Class Summary | |
---|---|
static class |
HeapAllocator.Allocation
Represents a heap allocation |
Method Summary | |
---|---|
void |
free(int pos)
Frees the given position in memory, which must have been allocated with malloc() |
java.util.Iterator<HeapAllocator.Allocation> |
getAllocations()
Gets an iterator to the allocations on the heap |
Memory |
getMemory()
Gets the memory object of this allocator |
void |
init()
Resets any internal state in the heap allocator to initial state. |
void |
malloc(int size)
Allocates the specified amount of memory on the heap, and pushes its address on the stack. |
void |
setMemory(Memory mem)
Sets the memory object of this allocator |
Method Detail |
---|
void init()
SystemException
- if there is an error accessing memoryvoid malloc(int size) throws SystemException
size
- the amount of memory to allocate
SystemException
- if there is an error allocating memoryvoid free(int pos) throws SystemException
SystemException
- if there is an error freeing memoryvoid setMemory(Memory mem)
mem
- the memoryMemory getMemory()
java.util.Iterator<HeapAllocator.Allocation> getAllocations()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |