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.

Heap Create, Delete, Open, Close

Hi All,

         "When the threads have finished using an instance, all threads that called MODULE_open() must call MODULE_close(). Then, the thread that

called MODULE_create() can call MODULE_delete() to free the memory used by the instance" -- IPC_USES_GUIDE.Pdf

w.r.t to above statement, I assume that this statement holds good for HEAP*buf, so in that case i have following doubts

1. Say i have a core0 CREATED heap and core 1 OPENED instance to it. Before core1 could CLOSE heap, Core0 DELETED it and then Core1 did try to CLOSE the heap, what happens in this case?

2. during my work/project, i observed that once a DELETED HEAP [in my case, the HEAP was created and deleted it on CORE0] related HeapId CANT be reused to register a new HEAP [tried to CREATE and REGISTER a new Heap with old HeapId, it didnt work and it used to give "#define HeapMemMP_E_ALREADYEXISTS     -4"]. please let me know on this and why is this so?.

Thanks

RC Reddy

  • RC,

    For #1, the local heap instance is simply deleted.  This should be okay to do.  Now if you actually tried using the heap instance after Core0 deleted it, that would be a problem.

    For #2, you mention HeapId.  Are you talking about registering a heap with MessageQ?  That's the only API which does a heap register that I can think of.  You simply need to call MessageQ_unregisterHeap(heapId).  Deleteing a heap does not unregister it with messageQ.

    Judah

  • Hi Judah,

                     Thanks for #2, that solved one of problems/issues i was facing.

    Thanks

    RC Reddy