Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsTiming of deleting instance from the internal queue
https://www.eclipse.org/forums/index.php/mv/msg/172784/549808/#msg_549808
Please assume Mod is characterized by @InstanceFinalize.
If Mod_delete/destruct() is called for runtime-created module instance, Mod_Instance_finalize is called.
Now question is :
Is this true that the Mod_Instance_finalize() is always called after clearing the instance registration from the internal Mod instance queue, which it can be searched by the following loop.
/* loop over all runtime created instances managed by «Mod» */
for (obj = «Mod»_Object_first(); obj != NULL; obj = «Mod»_Object_next(obj)) {
: /* use «Mod»_handle obj */
}
Regards,
-Kawada
]]>Naoki Kawada2010-07-28T05:05:31-00:00Re: Timing of deleting instance from the internal queue
https://www.eclipse.org/forums/index.php/mv/msg/172784/550503/#msg_550503
Mod_delete() eventually calls Core_deleteObject() which is defined in
the xdc.runtime package; see Core-mem.c. You can see from this function
that object deletion roughly proceeds as follows:
1. remove the instance from a its linked list
2. call the module's finalize function (if one is defined)
3. free up the memory of the instance object itself
On 7/27/2010 10:05 PM, Naoki Kawada wrote:
> Hi
>
> Please assume Mod is characterized by @InstanceFinalize.
> If Mod_delete/destruct() is called for runtime-created module instance,
> Mod_Instance_finalize is called.
>
> Now question is :
> Is this true that the Mod_Instance_finalize() is always called after
> clearing the instance registration from the internal Mod instance queue,
> which it can be searched by the following loop.
>
> -----------------------------------
> «Mod»_Handle obj;
>
> /* loop over all runtime created instances managed by «Mod» */
> for (obj = «Mod»_Object_first(); obj != NULL; obj =
> «Mod»_Object_next(obj)) {
> : /* use «Mod»_handle obj */
> }
>
> Regards,
> -Kawada
>]]>Dave Russo2010-07-30T14:37:25-00:00