From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Larmour To: Sandeep Rikhi Cc: "eCos Discussion Gp." Subject: Re: [ECOS] Thread Memory Date: Mon, 06 Nov 2000 21:29:00 -0000 Message-id: <3A0792ED.E412603C@cygnus.co.uk> References: X-SW-Source: 2000-11/msg00076.html 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