interface xdc.runtime.IHeap

Interface to heap functions

All heap implementations inherit from this interface. The implementations can have additional configuration parmeters and functions.
XDCspec summary sourced in xdc/runtime/IHeap.xdc
interface IHeap {  ...
// inherits xdc.runtime.IModule
instance:  ...
XDCspec declarations sourced in xdc/runtime/IHeap.xdc
package xdc.runtime;
 
interface IHeap {
module-wide config parameters
 
 
instance:
per-instance creation
per-instance functions
    Ptr alloc// Allocates a block of memory from the heap(SizeT size, SizeT align, Error.Block *eb);
    Void free// Free a block of memory back to the heap(Ptr block, SizeT size);
}
 
metaonly config IHeap.common$  // module-wide

Common module configuration parameters

XDCspec declarations sourced in xdc/runtime/IHeap.xdc
metaonly config Types.Common$ common$;
 
DETAILS
All modules have this configuration parameter. Its name contains the '$' character to ensure it does not conflict with configuration parameters declared by the module. This allows new configuration parameters to be added in the future without any chance of breaking existing modules.
Instance Creation

XDCspec declarations sourced in xdc/runtime/IHeap.xdc
create();
// Create an instance-object
DETAILS
See specific IHeap implementation for parameters used.
 
IHeap.alloc()  // instance

Allocates a block of memory from the heap

XDCspec declarations sourced in xdc/runtime/IHeap.xdc
Ptr alloc(SizeT size, SizeT align, Error.Block *eb);
 
ARGUMENTS
size — size (in MADUs) of the block
align — alignment (in MADUs) of the block
eb — pointer to error block
DETAILS
This method returns a block of memory from the heap. It is called by the xdc.runtime.Memory.alloc() function.
RETURNS
Returns the address of the allocated memory.
 
IHeap.free()  // instance

Free a block of memory back to the heap

XDCspec declarations sourced in xdc/runtime/IHeap.xdc
Void free(Ptr block, SizeT size);
 
ARGUMENTS
block — non-NULL address of allocated block to free
size — size (in MADUs) of the block of memory to free
DETAILS
This method gives back a block of memory to a heap. It is called by the xdc.runtime.Memory.free() function.
 
IHeap.getStats()  // instance

Retrieve the statistics from the heap

XDCspec declarations sourced in xdc/runtime/IHeap.xdc
Void getStats(Memory.Stats *stats);
 
ARGUMENTS
stats — non-NULL pointer to an output buffer
DETAILS
The caller passes in a pointer to a xdc.runtime.Memory.Stats structure and getStats fills in this structure.
This function is called by the xdc.runtime.Memory.getStats() function.
 
IHeap.isBlocking()  // instance

Returns whether the heap may block during an alloc() or free()

XDCspec declarations sourced in xdc/runtime/IHeap.xdc
Bool isBlocking();
 
RETURNS
If the heap might block, TRUE is returned. If the heap does not block, FALSE is returned.
generated on Thu, 27 Sep 2012 23:21:04 GMT