This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Thread Memory


Sandeep Rikhi wrote:
> 
> Respected Sir,
>  This may be very basic point in eCos.
> The doubt i have is that
> "How Do I free the memory which has been reserved for a particular
> thread?"
> I need to delete any data structures related to a particular thread and
> need the memory ( allocated for its stack etc.)
> to be marked as free. How do we do it?

Sorry for the slow reply.

The answer is that you have to do it yourself when you quit the thread.
Tracking all these resources would add a significant overhead to the
operation of eCos.

The memory allocated for a thread stack, for example, is under your
control, not the systems. If you used malloc to get it, then you must free
it. If it's a global variable, then obviously there's nothing you can do to
free it.

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]