This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
handle and structures
- To: "Ecos-List (E-mail)" <ecos-discuss at sourceware dot cygnus dot com>
- Subject: [ECOS] handle and structures
- From: Fabrice Gautier <Fabrice_Gautier at sdesigns dot com>
- Date: Fri, 18 Aug 2000 16:44:35 -0700
Hi,
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.
Thanks
A+
--
Fabrice Gautier
fabrice_gautier@sdesigns.com