SYS/BIOS  7.00
Data Fields
HeapBuf_Params Struct Reference

#include <ti/sysbios/heaps/HeapBuf.h>

Data Fields

size_t align
 Alignment (in MAUs) of each block. More...
 
unsigned int numBlocks
 Number of fixed-size blocks. More...
 
size_t blockSize
 Size (in MAUs) of each block. More...
 
size_t bufSize
 Size (in MAUs) of the entire buffer; for dynamic creates only. More...
 
void * buf
 User supplied buffer; for dynamic creates only. More...
 

Field Documentation

§ align

size_t HeapBuf_Params::align

Alignment (in MAUs) of each block.

The alignment must be a power of 2 that is greater than or equal to the target dependent value defined by 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 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.

§ numBlocks

unsigned int HeapBuf_Params::numBlocks

Number of fixed-size blocks.

Required parameter.

The default number of blocks is 0.

§ blockSize

size_t HeapBuf_Params::blockSize

Size (in MAUs) of each block.

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.

§ bufSize

size_t HeapBuf_Params::bufSize

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

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.

§ buf

void* HeapBuf_Params::buf

User supplied buffer; for dynamic creates only.

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.


The documentation for this struct was generated from the following file:
© Copyright 1995-2021, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale