module ti.sysbios.heaps.HeapBuf

Fixed size buffer heap manager

The HeapBuf manager provides functions to allocate and free storage from a heap of type HeapBuf which inherits from IHeap. HeapBuf manages a single fixed-size buffer, split into equally sized allocable blocks. [ more ... ]
C synopsis target-domain sourced in ti/sysbios/heaps/HeapBuf.xdc
#include <ti/sysbios/heaps/HeapBuf.h>
Functions
Void
Void
Void
Void 
Void
Functions common to all IHeap modules
Ptr 
Void 
Void 
Bool 
Functions common to all target instances
Functions common to all target modules
Typedefs
typedef struct
typedef HeapBuf_Object *
typedef struct
typedef struct
typedef struct
Constants
extern const Assert_Id 
extern const Assert_Id 
extern const Assert_Id 
extern const Assert_Id 
extern const Assert_Id 
extern const Assert_Id 
extern const Assert_Id 
extern const Assert_Id 
extern const Assert_Id 
extern const Error_Id 
extern const Bool 
 
DETAILS
The HeapBuf manager provides functions to allocate and free storage from a heap of type HeapBuf which inherits from IHeap. HeapBuf manages a single fixed-size buffer, split into equally sized allocable blocks.
The HeapBuf manager is intended as a very fast and deterministic memory manager which can only allocate blocks of a single size. It is ideal for managing a heap that is only used for allocating a single type of object, or for objects that have very similar sizes.
Allocation from and freeing to a HeapBuf instance is non-blocking and deterministic: a call to alloc or free will always take the same amount of time.
Constraints:
  • Align parameter must be set to 0 for default, or be a power of 2 that is greater than or equal to the value returned by xdc.runtime.Memory.getMaxDefaultTypeAlign.
  • The buffer passed to dynamically create a HeapBuf must be aligned according to the alignment parameter, and must be large enough to account for the actual block size after it has been rounded up to a multiple of the alignment.

Calling Context

Function Hwi Swi Task Main Startup
Params_init Y Y Y Y Y
alloc Y Y Y Y N
construct Y Y Y Y N
create N* N* Y Y N
delete N* N* Y Y N
destruct Y Y Y Y N
free Y Y Y Y N
getStats Y Y Y Y N
getExtendedStats Y Y Y Y N
isBlocking Y Y Y Y N
Definitions:
  • Hwi: API is callable from a Hwi thread.
  • Swi: API is callable from a Swi thread.
  • Task: API is callable from a Task thread.
  • Main: API is callable during any of these phases:
    • In your module startup after this module is started (e.g. HeapBuf_Module_startupDone() returns TRUE).
    • During xdc.runtime.Startup.lastFxns.
    • During main().
    • During BIOS.startupFxns.
  • Startup: API is callable during any of these phases:
    • During xdc.runtime.Startup.firstFxns.
    • In your module startup before this module is started (e.g. HeapBuf_Module_startupDone() returns FALSE).
  • *: Assuming blocking Heap is used for creation.
  • **: Assuming GateMutex is used as HeapMem's Gate.
  • + : Cannot use HeapMem object while it is being restored.
  •  
    struct HeapBuf_ExtendedStats

    Stat structure for the HeapBuf_getExtendedStats function

    C synopsis target-domain
    typedef struct HeapBuf_ExtendedStats {
        UInt maxAllocatedBlocks;
        UInt numAllocatedBlocks;
    } HeapBuf_ExtendedStats;
     
    FIELDS
    maxAllocatedBlocks — The maximum number of blocks allocated from this heap at any single point in time, during the lifetime of this HeapBuf instance.
    numAllocatedBlocks — The total number of blocks currently allocated in this HeapBuf instance.
     
    config HeapBuf_A_bufAlign  // module-wide

    Misalligned buffer

    C synopsis target-domain
    extern const Assert_Id HeapBuf_A_bufAlign;
     
    DETAILS
    This Assert is raised when the buf parameter has not been aligned on the requested alignment.
     
    config HeapBuf_A_invalidAlign  // module-wide

    Invalid alignment

    C synopsis target-domain
    extern const Assert_Id HeapBuf_A_invalidAlign;
     
    DETAILS
    This Assert is raised when the align parameter is not the default value of zero, or a power of 2 that is greater than or equal to the value defined by xdc.runtime.Memory.getMaxDefaultTypeAlign.
     
    config HeapBuf_A_invalidBufSize  // module-wide

    Invalid buffer size

    C synopsis target-domain
    extern const Assert_Id HeapBuf_A_invalidBufSize;
     
    DETAILS
    This Assert is raised when the bufSize parameter is too small to handle requested blocks.
     
    config HeapBuf_A_invalidFree  // module-wide

    Assert raised when an invalid free occurs

    C synopsis target-domain
    extern const Assert_Id HeapBuf_A_invalidFree;
     
    DETAILS
    This assert can be caused when passing a NULL pointer to the free.
     
    config HeapBuf_A_noBlocksToFree  // module-wide

    No allocated blocks

    C synopsis target-domain
    extern const Assert_Id HeapBuf_A_noBlocksToFree;
     
    DETAILS
    This Assert is raised when free is called and there are no blocks allocated.
     
    config HeapBuf_A_nullBuf  // module-wide

    Null buf parameter

    C synopsis target-domain
    extern const Assert_Id HeapBuf_A_nullBuf;
     
    DETAILS
    This Assert is raised when the buf parameter has been omitted (null) for a dynamic create.
     
    config HeapBuf_A_zeroBlockSize  // module-wide

    Assert raised when the blockSize parameter is 0

    C synopsis target-domain
    extern const Assert_Id HeapBuf_A_zeroBlockSize;
     
     
    config HeapBuf_A_zeroBlocks  // module-wide

    Assert raised when the numBlocks parameter is 0

    C synopsis target-domain
    extern const Assert_Id HeapBuf_A_zeroBlocks;
     
     
    config HeapBuf_A_zeroBufSize  // module-wide

    Assert raised when the bufSize parameter is 0

    C synopsis target-domain
    extern const Assert_Id HeapBuf_A_zeroBufSize;
     
     
    config HeapBuf_E_size  // module-wide

    Raised when requested size exceeds blockSize

    C synopsis target-domain
    extern const Error_Id HeapBuf_E_size;
     
     
    config HeapBuf_trackMaxAllocs  // module-wide

    Track maximum number of allocations

    C synopsis target-domain
    extern const Bool HeapBuf_trackMaxAllocs;
     
    DETAILS
    This will enable/disable the tracking of the maximum number of allocations for a HeapBuf instance. This maximum refers to the "all time" maximum number of allocations for the history of a HeapBuf instance, not the current number of allocations.
    Module-Wide Built-Ins

    C synopsis target-domain
    Types_ModuleId HeapBuf_Module_id();
    // Get this module's unique id
     
    Bool HeapBuf_Module_startupDone();
    // Test if this module has completed startup
     
    IHeap_Handle HeapBuf_Module_heap();
    // The heap from which this module allocates memory
     
    Bool HeapBuf_Module_hasMask();
    // Test whether this module has a diagnostics mask
     
    Bits16 HeapBuf_Module_getMask();
    // Returns the diagnostics mask for this module
     
    Void HeapBuf_Module_setMask(Bits16 mask);
    // Set the diagnostics mask for this module
    Instance Object Types

    C synopsis target-domain
    typedef struct HeapBuf_Object HeapBuf_Object;
    // Opaque internal representation of an instance object
     
    typedef HeapBuf_Object *HeapBuf_Handle;
    // Client reference to an instance object
     
    typedef struct HeapBuf_Struct HeapBuf_Struct;
    // Opaque client structure large enough to hold an instance object
     
    HeapBuf_Handle HeapBuf_handle(HeapBuf_Struct *structP);
    // Convert this instance structure pointer into an instance handle
     
    HeapBuf_Struct *HeapBuf_struct(HeapBuf_Handle handle);
    // Convert this instance handle into an instance structure pointer
    Instance Config Parameters

    C synopsis target-domain
    typedef struct HeapBuf_Params {
    // Instance config-params structure
        IInstance_Params *instance;
        // Common per-instance configs
        SizeT align;
        // Alignment (in MAUs) of each block
        SizeT blockSize;
        // Size (in MAUs) of each block
        Ptr buf;
        // User supplied buffer; for dynamic creates only
        Memory_Size bufSize;
        // Size (in MAUs) of the entire buffer; for dynamic creates only
        UInt numBlocks;
        // Number of fixed-size blocks
    } HeapBuf_Params;
     
    Void HeapBuf_Params_init(HeapBuf_Params *params);
    // Initialize this config-params structure with supplier-specified defaults before instance creation
     
    config HeapBuf_align  // instance

    Alignment (in MAUs) of each block

    C synopsis target-domain
    struct HeapBuf_Params {
          ...
        SizeT align;
     
    DETAILS
    The alignment must be a power of 2 that is greater than or equal to the target dependent value defined by xdc.runtime.Memory.getMaxDefaultTypeAlign. If the default value of 0 is specified, this value will be changed to be the minimum structure alignment requirement, as defined by xdc.runtime.Memory.getMaxDefaultTypeAlign.
    For static creates, the HeapBuf module will allocate space for the buffer and will align it on this requested alignment.
    For dynamic creates, this parameter is used solely for error checking. The buffer provided to a dynamically created HeapBuf must be aligned manually, and an assert will be raised if the buffer is not properly aligned. For dynamic creates, HeapBuf will NOT adjust the buffer to satisfy the alignment.
     
    config HeapBuf_blockSize  // instance

    Size (in MAUs) of each block

    C synopsis target-domain
    struct HeapBuf_Params {
          ...
        SizeT blockSize;
     
    DETAILS
    HeapBuf will round the blockSize up to the nearest multiple of the alignment, so the actual blockSize may be larger. When creating a HeapBuf dynamically, this needs to be taken into account to determine the proper buffer size to pass in.
    Required parameter.
    The default size of the blocks is 0 MAUs.
     
    config HeapBuf_buf  // instance

    User supplied buffer; for dynamic creates only

    C synopsis target-domain
    struct HeapBuf_Params {
          ...
        Ptr buf;
     
    DETAILS
    The caller must supply the memory buffer for a dynamically created HeapBuf to manage. The provided buffer must be aligned according to the HeapBuf's alignment parameter. i.e., if a buffer's alignment parameter is 128, then the buffer's start address must be a multiple of 128.
    For static creates, the buffer is allocated automatically based on the blockSize and numBlocks parameters.
    This parameter is required for dynamic creates and ignored for static creates.
     
    config HeapBuf_bufSize  // instance

    Size (in MAUs) of the entire buffer; for dynamic creates only

    C synopsis target-domain
    struct HeapBuf_Params {
          ...
        Memory_Size bufSize;
     
    DETAILS
    When dynamically creating a HeapBuf, this should be the actual size of the memory buffer provided for HeapBuf to manage.
    This parameter is used solely for error checking; an Error is raised if the bufSize is too small for the requested blockSize and numBlocks. Because of minimum alignment considerations, it's easy to provide too small of a buffer to manage, and difficult to detect if it happened.
    This parameter is required for dynamic creates and ignored for static creates.
    The default buffer size is 0 MAUs.
     
    config HeapBuf_numBlocks  // instance

    Number of fixed-size blocks

    C synopsis target-domain
    struct HeapBuf_Params {
          ...
        UInt numBlocks;
     
    DETAILS
    Required parameter.
    The default number of blocks is 0.
    Instance Creation

    C synopsis target-domain
    HeapBuf_Handle HeapBuf_create(const HeapBuf_Params *params, Error_Block *eb);
    // Allocate and initialize a new instance object and return its handle
     
    Void HeapBuf_construct(HeapBuf_Struct *structP, const HeapBuf_Params *params, Error_Block *eb);
    // Initialize a new instance object inside the provided structure
    ARGUMENTS
    params — per-instance config params, or NULL to select default values (target-domain only)
    eb — active error-handling block, or NULL to select default policy (target-domain only)
    DETAILS
    See specific IHeap implementation for parameters used.
    Instance Deletion

    C synopsis target-domain
    Void HeapBuf_delete(HeapBuf_Handle *handleP);
    // Finalize and free this previously allocated instance object, setting the referenced handle to NULL
     
    Void HeapBuf_destruct(HeapBuf_Struct *structP);
    // Finalize the instance object inside the provided structure
     
    HeapBuf_alloc()  // instance

    Allocates a block of memory from the heap

    C synopsis target-domain
    Ptr HeapBuf_alloc(HeapBuf_Handle handle, SizeT size, SizeT align, Error_Block *eb);
     
    ARGUMENTS
    handle — handle of a previously-created HeapBuf instance object
    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.
    HeapBuf_alloc will only fail if there are no available blocks or if the requested block size is larger than the HeapBuf's blockSize. All other requests, regardless of size, will succeed.
    HEAPBUF
    All alignment is handled in the create, therefore the align argument in alloc is ignored.
    RETURNS
    Returns the address of the allocated memory.
     
    HeapBuf_free()  // instance

    Free a block of memory back to the heap

    C synopsis target-domain
    Void HeapBuf_free(HeapBuf_Handle handle, Ptr block, SizeT size);
     
    ARGUMENTS
    handle — handle of a previously-created HeapBuf instance object
    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.
     
    HeapBuf_getExtendedStats()  // instance

    Retrieves the extended statistics for a HeapBuf instance

    C synopsis target-domain
    Void HeapBuf_getExtendedStats(HeapBuf_Handle handle, HeapBuf_ExtendedStats *stats);
     
    ARGUMENTS
    handle — handle of a previously-created HeapBuf instance object
    stats — Location for the returned extended statistics.
    DETAILS
    This function retrieves the extended statistics for a HeapBuf instance. It does not retrieve the standard xdc.runtime.Memory.Stats information.
     
    HeapBuf_getStats()  // instance

    Retrieve the statistics from the heap

    C synopsis target-domain
    Void HeapBuf_getStats(HeapBuf_Handle handle, Memory_Stats *stats);
     
    ARGUMENTS
    handle — handle of a previously-created HeapBuf instance object
    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.
     
    HeapBuf_isBlocking()  // instance

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

    C synopsis target-domain
    Bool HeapBuf_isBlocking(HeapBuf_Handle handle);
     
    ARGUMENTS
    handle — handle of a previously-created HeapBuf instance object
    HEAPBUF
    This function always returns FALSE since the alloc/free never block on a resource.
    RETURNS
    If the heap might block, TRUE is returned. If the heap does not block, FALSE is returned.
    Instance Convertors

    C synopsis target-domain
    IHeap_Handle HeapBuf_Handle_upCast(HeapBuf_Handle handle);
    // unconditionally move one level up the inheritance hierarchy
     
    HeapBuf_Handle HeapBuf_Handle_downCast(IHeap_Handle handle);
    // conditionally move one level down the inheritance hierarchy; NULL upon failure
    Instance Built-Ins

    C synopsis target-domain
    Int HeapBuf_Object_count();
    // The number of statically-created instance objects
     
    HeapBuf_Handle HeapBuf_Object_get(HeapBuf_Object *array, Int i);
    // The handle of the i-th statically-created instance object (array == NULL)
     
    HeapBuf_Handle HeapBuf_Object_first();
    // The handle of the first dynamically-created instance object, or NULL
     
    HeapBuf_Handle HeapBuf_Object_next(HeapBuf_Handle handle);
    // The handle of the next dynamically-created instance object, or NULL
     
    IHeap_Handle HeapBuf_Object_heap();
    // The heap used to allocate dynamically-created instance objects
     
    Types_Label *HeapBuf_Handle_label(HeapBuf_Handle handle, Types_Label *buf);
    // The label associated with this instance object
     
    String HeapBuf_Handle_name(HeapBuf_Handle handle);
    // The name of this instance object
     
    XDCscript usage meta-domain sourced in ti/sysbios/heaps/HeapBuf.xdc
    var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
    module-wide constants & types
            obj.maxAllocatedBlocks = UInt  ...
            obj.numAllocatedBlocks = UInt  ...
    module-wide config parameters
            msg: "buf not properly aligned"
        };
            msg: "align parameter must be 0 or a power of 2 >= the value of Memory_getMaxDefaultTypeAlign()"
        };
            msg: "HeapBuf_create's bufSize parameter is invalid (too small)"
        };
            msg: "A_invalidFree: Invalid free"
        };
            msg: "Cannot call HeapBuf_free when no blocks have been allocated"
        };
            msg: "buf parameter cannot be null"
        };
            msg: "blockSize cannot be zero"
        };
            msg: "numBlocks cannot be zero"
        };
            msg: "bufSize cannot be zero"
        };
            msg: "requested size is too big: handle=0x%x, size=%u"
        };
     
    per-instance config parameters
        var params = new HeapBuf.Params// Instance config-params object;
            params.align// Alignment (in MAUs) of each block = SizeT 0;
            params.blockSize// Size (in MAUs) of each block = SizeT 0;
            params.numBlocks// Number of fixed-size blocks = UInt 0;
    per-instance creation
        var inst = HeapBuf.create// Create an instance-object(params);
     
     
    struct HeapBuf.ExtendedStats

    Stat structure for the HeapBuf_getExtendedStats function

    XDCscript usage meta-domain
    var obj = new HeapBuf.ExtendedStats;
     
        obj.maxAllocatedBlocks = UInt  ...
        obj.numAllocatedBlocks = UInt  ...
     
    FIELDS
    maxAllocatedBlocks — The maximum number of blocks allocated from this heap at any single point in time, during the lifetime of this HeapBuf instance.
    numAllocatedBlocks — The total number of blocks currently allocated in this HeapBuf instance.
    C SYNOPSIS
     
    config HeapBuf.A_bufAlign  // module-wide

    Misalligned buffer

    XDCscript usage meta-domain
    HeapBuf.A_bufAlign = Assert.Desc {
        msg: "buf not properly aligned"
    };
     
    DETAILS
    This Assert is raised when the buf parameter has not been aligned on the requested alignment.
    C SYNOPSIS
     
    config HeapBuf.A_invalidAlign  // module-wide

    Invalid alignment

    XDCscript usage meta-domain
    HeapBuf.A_invalidAlign = Assert.Desc {
        msg: "align parameter must be 0 or a power of 2 >= the value of Memory_getMaxDefaultTypeAlign()"
    };
     
    DETAILS
    This Assert is raised when the align parameter is not the default value of zero, or a power of 2 that is greater than or equal to the value defined by xdc.runtime.Memory.getMaxDefaultTypeAlign.
    C SYNOPSIS
     
    config HeapBuf.A_invalidBufSize  // module-wide

    Invalid buffer size

    XDCscript usage meta-domain
    HeapBuf.A_invalidBufSize = Assert.Desc {
        msg: "HeapBuf_create's bufSize parameter is invalid (too small)"
    };
     
    DETAILS
    This Assert is raised when the bufSize parameter is too small to handle requested blocks.
    C SYNOPSIS
     
    config HeapBuf.A_invalidFree  // module-wide

    Assert raised when an invalid free occurs

    XDCscript usage meta-domain
    HeapBuf.A_invalidFree = Assert.Desc {
        msg: "A_invalidFree: Invalid free"
    };
     
    DETAILS
    This assert can be caused when passing a NULL pointer to the free.
    C SYNOPSIS
     
    config HeapBuf.A_noBlocksToFree  // module-wide

    No allocated blocks

    XDCscript usage meta-domain
    HeapBuf.A_noBlocksToFree = Assert.Desc {
        msg: "Cannot call HeapBuf_free when no blocks have been allocated"
    };
     
    DETAILS
    This Assert is raised when free is called and there are no blocks allocated.
    C SYNOPSIS
     
    config HeapBuf.A_nullBuf  // module-wide

    Null buf parameter

    XDCscript usage meta-domain
    HeapBuf.A_nullBuf = Assert.Desc {
        msg: "buf parameter cannot be null"
    };
     
    DETAILS
    This Assert is raised when the buf parameter has been omitted (null) for a dynamic create.
    C SYNOPSIS
     
    config HeapBuf.A_zeroBlockSize  // module-wide

    Assert raised when the blockSize parameter is 0

    XDCscript usage meta-domain
    HeapBuf.A_zeroBlockSize = Assert.Desc {
        msg: "blockSize cannot be zero"
    };
     
    C SYNOPSIS
     
    config HeapBuf.A_zeroBlocks  // module-wide

    Assert raised when the numBlocks parameter is 0

    XDCscript usage meta-domain
    HeapBuf.A_zeroBlocks = Assert.Desc {
        msg: "numBlocks cannot be zero"
    };
     
    C SYNOPSIS
     
    config HeapBuf.A_zeroBufSize  // module-wide

    Assert raised when the bufSize parameter is 0

    XDCscript usage meta-domain
    HeapBuf.A_zeroBufSize = Assert.Desc {
        msg: "bufSize cannot be zero"
    };
     
    C SYNOPSIS
     
    config HeapBuf.E_size  // module-wide

    Raised when requested size exceeds blockSize

    XDCscript usage meta-domain
    HeapBuf.E_size = Error.Desc {
        msg: "requested size is too big: handle=0x%x, size=%u"
    };
     
    C SYNOPSIS
     
    config HeapBuf.trackMaxAllocs  // module-wide

    Track maximum number of allocations

    XDCscript usage meta-domain
    HeapBuf.trackMaxAllocs = Bool false;
     
    DETAILS
    This will enable/disable the tracking of the maximum number of allocations for a HeapBuf instance. This maximum refers to the "all time" maximum number of allocations for the history of a HeapBuf instance, not the current number of allocations.
    C SYNOPSIS
     
    metaonly config HeapBuf.common$  // module-wide

    Common module configuration parameters

    XDCscript usage meta-domain
    HeapBuf.common$ = Types.Common$ undefined;
     
    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 Config Parameters

    XDCscript usage meta-domain
    var params = new HeapBuf.Params;
    // Instance config-params object
        params.align = SizeT 0;
        // Alignment (in MAUs) of each block
        params.blockSize = SizeT 0;
        // Size (in MAUs) of each block
        params.buf = Ptr 0;
        // User supplied buffer; for dynamic creates only
        params.bufSize = UArg 0;
        // Size (in MAUs) of the entire buffer; for dynamic creates only
        params.numBlocks = UInt 0;
        // Number of fixed-size blocks
        params.sectionName = String null;
        // Section name for the buffer managed by the instance
     
    config HeapBuf.align  // instance

    Alignment (in MAUs) of each block

    XDCscript usage meta-domain
    var params = new HeapBuf.Params;
      ...
    params.align = SizeT 0;
     
    DETAILS
    The alignment must be a power of 2 that is greater than or equal to the target dependent value defined by xdc.runtime.Memory.getMaxDefaultTypeAlign. If the default value of 0 is specified, this value will be changed to be the minimum structure alignment requirement, as defined by xdc.runtime.Memory.getMaxDefaultTypeAlign.
    For static creates, the HeapBuf module will allocate space for the buffer and will align it on this requested alignment.
    For dynamic creates, this parameter is used solely for error checking. The buffer provided to a dynamically created HeapBuf must be aligned manually, and an assert will be raised if the buffer is not properly aligned. For dynamic creates, HeapBuf will NOT adjust the buffer to satisfy the alignment.
    C SYNOPSIS
     
    config HeapBuf.blockSize  // instance

    Size (in MAUs) of each block

    XDCscript usage meta-domain
    var params = new HeapBuf.Params;
      ...
    params.blockSize = SizeT 0;
     
    DETAILS
    HeapBuf will round the blockSize up to the nearest multiple of the alignment, so the actual blockSize may be larger. When creating a HeapBuf dynamically, this needs to be taken into account to determine the proper buffer size to pass in.
    Required parameter.
    The default size of the blocks is 0 MAUs.
    C SYNOPSIS
     
    config HeapBuf.buf  // instance

    User supplied buffer; for dynamic creates only

    XDCscript usage meta-domain
    var params = new HeapBuf.Params;
      ...
    params.buf = Ptr 0;
     
    DETAILS
    The caller must supply the memory buffer for a dynamically created HeapBuf to manage. The provided buffer must be aligned according to the HeapBuf's alignment parameter. i.e., if a buffer's alignment parameter is 128, then the buffer's start address must be a multiple of 128.
    For static creates, the buffer is allocated automatically based on the blockSize and numBlocks parameters.
    This parameter is required for dynamic creates and ignored for static creates.
    C SYNOPSIS
     
    config HeapBuf.bufSize  // instance

    Size (in MAUs) of the entire buffer; for dynamic creates only

    XDCscript usage meta-domain
    var params = new HeapBuf.Params;
      ...
    params.bufSize = UArg 0;
     
    DETAILS
    When dynamically creating a HeapBuf, this should be the actual size of the memory buffer provided for HeapBuf to manage.
    This parameter is used solely for error checking; an Error is raised if the bufSize is too small for the requested blockSize and numBlocks. Because of minimum alignment considerations, it's easy to provide too small of a buffer to manage, and difficult to detect if it happened.
    This parameter is required for dynamic creates and ignored for static creates.
    The default buffer size is 0 MAUs.
    C SYNOPSIS
     
    config HeapBuf.numBlocks  // instance

    Number of fixed-size blocks

    XDCscript usage meta-domain
    var params = new HeapBuf.Params;
      ...
    params.numBlocks = UInt 0;
     
    DETAILS
    Required parameter.
    The default number of blocks is 0.
    C SYNOPSIS
     
    metaonly config HeapBuf.sectionName  // instance

    Section name for the buffer managed by the instance

    XDCscript usage meta-domain
    var params = new HeapBuf.Params;
      ...
    params.sectionName = String null;
     
    DETAILS
    The buffer allocated for a statically created HeapBuf instance will be placed in this section.
    The default section is the 'dataSection' in the platform.
    Instance Creation

    XDCscript usage meta-domain
    var params = new HeapBuf.Params;
    // Allocate instance config-params
    params.config =   ...
    // Assign individual configs
     
    var inst = HeapBuf.create(params);
    // Create an instance-object
    ARGUMENTS
    params — per-instance config params, or NULL to select default values (target-domain only)
    eb — active error-handling block, or NULL to select default policy (target-domain only)
    DETAILS
    See specific IHeap implementation for parameters used.
    generated on Thu, 01 Mar 2012 16:57:57 GMT