This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Thread Memory
- To: Sandeep Rikhi <sr at cdotb dot ernet dot in>
- Subject: Re: [ECOS] Thread Memory
- From: Jonathan Larmour <jlarmour at cygnus dot co dot uk>
- Date: Tue, 07 Nov 2000 05:28:13 +0000
- CC: "eCos Discussion Gp." <ecos-discuss at sourceware dot cygnus dot com>
- Organization: Red Hat UK Ltd.
- References: <Pine.OSF.4.21.0009191640010.12552-100000@ws9.cdotb.ernet.in>
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