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.

CMEM

Hi, everyone !

As we know, when we want to allocate the CMEM, we can use loadmodules.sh.

In the file: cmem.c, I know there are two types: pool and heap.

Pool is defined in loadmodules.sh, But where is the heap??

In addition, where should we use the heap?? 

  • This heap means DDRALGHEAP??

  • Hello!

     

    If you configure cmem to have pools, you can allocate from those pools by specifying the alloc type as CONTIGPOOL, and if there is any space left, you can allocate from it via CONTIGHEAP.

    You have -say- 10Mb mem designated for cmem, you declare 2x2Mb, and 1x5Mb pools. You can now alloc 1x up to 5Mb, or separately 3x2Mb as pools, and then some more by allocating via CONTIGHEAP.

    [[pool1: 2Mb][pool2: 2Mb][pool3: 5Mb]...heap: 1Mb...]

     

    If you don't specify any pools, you can use all the space as a heap. (meaning Memory_alloc()/CMEM_alloc() with CONTIGHEAP works similarly to the regular malloc()-call, but allocates from the designated CMEM-area)

     

    DDRALGHEAP is a memory section name from the perspective of the dsp side: the space CODEC ENGINE algorithms, like the h264 encoder allocate their memory from.