BUF Module
2-16
Module Configuration Parameters
Instance Configuration Parameters
Description
The BUF module maintains pools of fixed-size buffers. These buffer
pools can be created statically or dynamically. Dynamically-created
buffer pools are allocated from a dynamic memory heap managed by the
MEM module. Applications typically allocate buffer pools statically when
size and alignment constraints are known at design time. Run-time
allocation is used when these constraints vary during execution.
Within a buffer pool, all buffers have the same size and alignment.
Although each frame has a fixed length, the application can put a variable
amount of data in each frame, up to the length of the frame. You can
create multiple buffer pools, each with a different buffer size.
Buffers can be allocated and freed from a pool as needed at run-time
using the BUF_alloc and BUF_free functions.
The advantages of allocating memory from a buffer pool instead of from
the dynamic memory heaps provided by the MEM module include:
❏
Deterministic allocation times.
The BUF_alloc and BUF_free
functions require a constant amount of time. Allocating and freeing
memory through a heap is not deterministic.
❏
Callable from all thread types.
Allocating and freeing buffers is
atomic and non-blocking. As a result, BUF_alloc and BUF_free can
be called from all types of DSP/BIOS threads: HWI, SWI, TSK, and
IDL. In contrast, HWI and SWI threads cannot call MEM_alloc.
❏
Optimized for fixed-length allocation.
In contrast MEM_alloc is
optimized for variable-length allocation.
Name
Type
Default (Enum Options)
OBJMEMSEG
Reference
prog.get("DARAM")
Name
Type
Default (Enum Options)
comment
String
"<add comments here>"
bufSeg
Reference
prog.get("DARAM")
bufCount
Int32
1
size
Int32
4 (’C55x)
align
Int32
2 (’C55x)
len
Int32
4 (’C55x)
postalignsize
Int32
4 (’C55x)