[ECOS] cyg_semaphore_destroy, cyg_mutex_destroy, etc...

Nick Garnett nickg@cygnus.co.uk
Fri Aug 18 04:00:00 GMT 2000


Fabrice Gautier <Fabrice_Gautier@sdesigns.com> writes:

> Hi,
> 
> Since the memory for semaphore or mutexes must be allocated before the call
> to the *_create functions, I'm wondering what the *_destroy functions
> actually do?

At present nothing. However if we ever have a machanism where these
structures get registered with the kernel in some way, the destroy
functions would deregister them. 

> 
> I have the same question for other structures like Counters, Clokcs etc...
> 
> In the documentation it is said about cyg_counter_delete and
> cyg_clock_delete that they free the memory used by the structure. ABout
> cyg_alarm_delete it is ais that it frees the meory IF it was dinamycally
> allocated. Since there is not yet support for the dynamic allocation in the
> creates functions, I think that the "free  memory" feature is not already
> implemented, right?
> 

A lot of the documentation was written so that when/if we ever
implement the dynamic memory allocation in the KAPI, it would not have
to be changed. This means that it often talks about freeing memory
when in fact it does not such thing.

Since none of this has yet been done, you are correct in assuming that
the "free memory" feature is not yet implemented. At present all of
the KAPI interfaces expect the caller to supply all the memory needed
for the objects they control.

-- 
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK


More information about the Ecos-discuss mailing list