python-on-a-chip online compiler
Dependencies:
mbed
TSI
« Back to documentation index
heap.h File Reference
VM Heap.
More...
Go to the source code of this file.
Detailed Description
VM Heap.
VM heap header.
Definition in file heap.h .
Function Documentation
Places the chunk back in the heap.
Parameters:
ptr Pointer to object to free.
Definition at line 601 of file heap.c .
void heap_gcPopTempRoot
(
uint8_t
objid )
Pops from the temporary roots stack all objects upto and including the one denoted by the given ID.
Parameters:
Definition at line 1234 of file heap.c .
void heap_gcPushTempRoot
(
pPmObj_t
pobj ,
uint8_t *
r_objid
)
Pushes an object onto the temporary roots stack if there is room to protect the objects from a potential garbage collection.
Parameters:
pobj Object to push onto the roots stack
r_objid By reference; ID to use when popping the object from the stack
Definition at line 1222 of file heap.c .
Runs the mark-sweep garbage collector.
Returns: Return code
Definition at line 1192 of file heap.c .
Enables (if true) or disables automatic garbage collection.
Parameters:
bool Value to enable or disable auto GC
Returns: Return code
Definition at line 1216 of file heap.c .
uint32_t heap_getAvail
(
void
)
Returns: Return number of bytes available in the heap
Definition at line 625 of file heap.c .
PmReturn_t heap_getChunk
(
uint16_t
requestedsize ,
uint8_t **
r_pchunk
)
Returns a free chunk from the heap.
The chunk will be at least the requested size. The actual size can be found in the return chunk's od.od_size.
Parameters:
requestedsize Requested size of the chunk in bytes.
r_pchunk Addr of ptr to chunk (return).
Returns: Return code
Definition at line 533 of file heap.c .
uint32_t heap_getSize
(
void
)
Returns: Return the size of the heap in bytes
Definition at line 632 of file heap.c .
PmReturn_t heap_init
(
uint8_t *
base ,
uint32_t
size
)
Initializes the heap for use.
Parameters:
base The address where the contiguous heap begins
size The size in bytes (octets) of the given heap.
Returns: Return code.
Definition at line 372 of file heap.c .