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.

HeapMem_alloc failure terminates execution even when error block is used

Other Parts Discussed in Thread: SYSBIOS

Why the execution is terminated when allocation fails with the following code? If I've understood correctly, the execution should be returned to the caller in case that error block != NULL.

Error_Block errorBlock;
Error_init(&errorBlock);

pPacket = (Header *) HeapMem_alloc(heap, size , 1, &errorBlock);
if (Error_check(&errorBlock))
{
  // this is not fatal for us. we can do here something to recover from the situation.
}

All other parameters are ok, i.e. allocation works fine when there is room in the heap.