Hi,
Is there a misprint in Sys/Bios user guide on the paragraph explaining about heaps allocation ?
Paragraphs 7.8.2 / 7.8.3 memory is set aside for th heap in the following way:
HeapBuf_Params prms;
static char *buf[1280]; // NOTE THE POINTER
HeapBuf_Handle heap;
Error_Block eb;
Error_init(&eb);
HeapBuf_Params_init(&prms);
prms.blockSize = 128;
prms.numBlocks = 10;
prms.buf = buf;
prms.bufSize = 1280;
heap = HeapBuf_create(&prms, &eb);
if (heap == NULL) {
System_abort("HeapBuf create failed");
}
In paragraph 7.8.4 in another way (no pointer)
HeapMultiBuf_Params prms; HeapMultiBuf_Handle heap; Error_Block eb; Error_init(&eb); /* Create the buffers to manage */ Char buf0[128]; // NO POINTERS Char buf1[256]; // NO POINTERS Char buf2[640]; // NO POINTERS /* Create the array of HeapBuf_Params */ HeapBuf_Params bufParams[3]; /* Load the default values */ HeapMultiBuf_Params_init(&prms); prms.numBufs = 3; prms.bufParams = bufParams;
Can someone confirm which is right (I guess the later..) ?
Thanks