Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

HeapMemMP_alloc clarification

$
0
0

sysbios 6.34.03.19, ipc 1.25.1.9

The documentation suggests that HeapMemMP_alloc just returns NULL if the allocation isn't possible, and to me this is the correct behavior.  However, it is also raising an error (E_memory).  To me, this is broken.  A heap can be used in many contexts, and only the client can decide if a failed allocation is an error to be reported, or just a situation that must be handled.  For instance, in my case, I'm not calling HeapMemMP_alloc directly-- it's being called by MessageQ_alloc, which is being called in the idiomatic loop

while ((msg = MessageQ_alloc(...)) != NULL)

    Task_sleep(n);

I'm ok with blocking when the heap is full and I know that (barring total breakdown) eventually the allocation will succeed (or the Task will be made inactive).

I'm hoping you agree and will fix this.

Thanks


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>