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.

DSP/BIOS 4.90.270 - 6713 - MEM_define/MEM_alloc

Hello,

i am currently using DSP/BIOS 4.90.270 with TMS320C6713 DSP. I get some old code which i need to update. Actualy, in this code, all memory bloc allocate with MEM_define/MEM_alloc are map to a structure like that:

typedef struct {

    volatile void*                 memHeaderList;
    volatile unsigned int   memHeaderSize;
    unsigned char*           pData;
 
} data;

data* ptr;
segmentId = MEM_define((Ptr)0x80000000, 0x1000, NULL);
ptr = MEM_alloc(segmentId, 0x1000, 4);

where only space pointed by pData is used. So everytime memory is allocated, "memHeaderList" and "memHeaderSize" are not used.

I have looked in the DSP/BIOS documentation for understand why this header must be reserved, but i found nothing.

Is there someone who understand why the guy who write this code always reserve a header on each bloc allocated ?

 

 

  • Hi,
    Which example code are you referring ?
  • Hello,

    this code has been made 10 years ago (internally to our company). I need to make some modifications in order to insert new fonctionnalites.
    It is like DSP/BIOS needs to chain memories blocs and use this header for this purpose.

    Is it necessary to avoid using the 2*4 bytes at the beginning of the reserve memory  (like it is done in  this code example) ?

  • Sebastien,

    I do not believe we are going to be able to tell you why your programmer wrote this code the way he did. The struct that you show is not a BIOS struct but is created outside of BIOS and is mapped onto the new space that gets allocated by the MEM_alloc call. 4KBytes are being allocated to a block that you are assigning to struct that is nowhere near that size. My interpretation is that most of those 4KBytes are being left useless in the assigned memory region.

    What is the document number for the DSP/BIOS User Guide that you have for DSP/BIOS 4.92? That is so old that I do not have any copies of it on my PC, and I hang onto things like that for a very long time.

    Any data structs that BIOS uses to keep track of its heap allocation will be handled outside of the user's scope.

    A Moderator will move this thread to the TI-RTOS (today's name for the BIOS products) forum where there might be someone more able to come up with a guess for you. But it is really not something we tend to practice, guessing why someone wrote their code outside of the scope of our libraries and tools.

    Regards,
    RandyP
  • Thank a lot for your help.Sébastien