Main Page | Class List | Directories | File List | Class Members | File Members

vm_heap.h File Reference

CKPM virtual machine heap definitions. More...

#include "vm.h"

Defines

#define VM_MIN_HEAP_STACK_DIST   256

Typedefs

typedef _vm_heap_entry vm_heap_entry_t
 head of an allocated / free memory chunk
typedef _vm_heap vm_heap_t
 the heap management information

Functions

void Heap_Init (vm_mem_t *m)
 initialise the virtual machine heap management
vm_addr_t Heap_Allocate (vm_mem_t *m, vm_size_t sz)
 allocate memory on the heap with first fit algorithm
void Heap_Deallocate (vm_mem_t *m, vm_addr_t a)
 deallocate memory on the heap
void Heap_Cleanup (vm_mem_t *m)
 cleanup the heap and merge free list entries
void Heap_Dump (vm_mem_t *m, int verbose)
 dump the heap management structure to a file


Detailed Description

CKPM virtual machine heap definitions.


Define Documentation

#define VM_MIN_HEAP_STACK_DIST   256
 

minimal distance between heap and stack in bytes


Function Documentation

vm_addr_t Heap_Allocate vm_mem_t m,
vm_size_t  sz
 

allocate memory on the heap with first fit algorithm

Parameters:
m the virtual machine memory
sz the size of bytes to be allocated
Returns:
a pointer to the newly allocated memory if successful, otherwise 0

void Heap_Cleanup vm_mem_t m  ) 
 

cleanup the heap and merge free list entries

Parameters:
m the virtual machine memory

void Heap_Deallocate vm_mem_t m,
vm_addr_t  a
 

deallocate memory on the heap

Parameters:
m the virtual machine memory
a the address of the allocated memory as returned from Heap_Allocate().

void Heap_Dump vm_mem_t m,
int  verbose
 

dump the heap management structure to a file

Parameters:
m the virtual machine memory
verbose if != 0 this function will provide verbose output, i.e. dumps the heap memory

void Heap_Init vm_mem_t m  ) 
 

initialise the virtual machine heap management

Parameters:
m the virtual machine memory
Returns:
a pointer to the heap management structure within the virtual machine memory


Generated on Thu Jul 13 03:56:37 2006 for CKPMcc by  doxygen 1.4.4