[ECOS] handle and structures

Fabrice Gautier Fabrice_Gautier@sdesigns.com
Fri Aug 18 16:46:00 GMT 2000


Most of the objects created cyg_*_create function are refered to by an
handle (type cyg_handle_t) but in the meanwhile they need some memory to be
allocated, which address is usually passed as the  last parameter of the
*_create function (which type is cyg_thread, cyg_interrupt, etc...)

So before to call the _create function I usually do a malloc, and pass the
resulting address to the function. But since the other function to
manipulate the object only need the handle, I don't keep track of the memory
I allocated.

So who can I free the memory after the *_delete function ?
Do I have to keep track of the memory allocation for each new object?
Or can I simply assume that in fact the handle and the pointer are just the
same thing (after a typecast) so I canjust do "free(my_handle)" ?

It seems that it is the case at least for thread objects.



Fabrice Gautier

More information about the Ecos-discuss mailing list