heap.h File Reference

VM Heap. More...

Go to the source code of this file.

Defines

#define HEAP_GC_NF_THRESHOLD   (512)
#define DEBUG_PRINT_HEAP_AVAIL(s)

Functions

PmReturn_t heap_init (void)
PmReturn_t heap_getChunk (uint16_t requestedsize, uint8_t **r_pchunk)
PmReturn_t heap_freeChunk (pPmObj_t ptr)
uint16_t heap_getAvail (void)
void heap_gcPushTempRoot (pPmObj_t pobj, uint8_t *r_objid)
void heap_gcPopTempRoot (uint8_t objid)


Detailed Description

VM Heap.

VM heap header.

Definition in file heap.h.


Define Documentation

#define HEAP_GC_NF_THRESHOLD   (512)

The threshold of heap.avail under which the interpreter will run the GC just before starting a native session.

Definition at line 32 of file heap.h.


Function Documentation

PmReturn_t heap_freeChunk ( pPmObj_t  ptr  ) 

Places the chunk back in the heap.

Parameters:
ptr Pointer to object to free.

Definition at line 549 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:
objid ID of object to pop

Definition at line 1184 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 1183 of file heap.c.

uint16_t heap_getAvail ( void   ) 

Returns:
Return number of bytes available in the heap

Definition at line 578 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 498 of file heap.c.

PmReturn_t heap_init ( void   ) 

Initializes the heap for use.

Returns:
nothing.

Definition at line 352 of file heap.c.


Generated on Mon Oct 18 07:40:49 2010 for Python-on-a-chip by  doxygen 1.5.9