This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

performance of HeapMultiBuf

Other Parts Discussed in Thread: SYSBIOS

we porting a Linux based application to sysbios on dsp. We want to implement malloc/free using a single HeapMultibuf so that we do not have to always keep track of the heap we have to return the buffer back to.

1. Is there alignement and size limitations on the buffer size used in HeapMultiBuf?

2. With increasing number of different sizes used in HeapMultiBuf, the malloc has to search more. What is the recommended maximum number of different buffer sizes we can put into one HeapMultiBuf?

Thanks

Weichun

  • Hi Weichun,

    The only alignment restriction is that it should be a power of 2. There is no buffer size restriction except it should be a multiple of alignment.

    The alloc/free time would proportionally increase with the number of HeapBuf instances managed by HeapMultiBuf. That said, I believe the alloc time increase would not be too high as SYS/BIOS only loops through to check the buffer sizes used by each HeapBuf instance to determine which HeapBuf instance to use. Once the HeapBuf instance is selected, a fixed time freelist queue operation is performed. So the performance penalty of adding more HeapBuf instances (different sizes) should be minimal.

    Best,

    Ashish

  • Weichun,

    Adding to my previous post. Have you looked at the cdoc for HeapMultiBuf ? It has some important info that you should go over. Here's the link to the cdoc for latest version (6.35.01.29) of BIOS:

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/sysbios/6_35_01_29/exports/bios_6_35_01_29/docs/cdoc/index.html#ti/sysbios/heaps/HeapMultiBuf.html

    Best,

    Ashish