Path: utzoo!attcan!uunet!wuarchive!brutus.cs.uiuc.edu!apple!sun-barr!sun!quintus!pds
From: pds@quintus.UUCP (Peter Schachte)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Minix, Unix on the Amiga...
Message-ID: <1243@quintus.UUCP>
Date: 16 Aug 89 17:42:15 GMT
References: <8908082312.AA10140@jade.berkeley.edu> <120408@sun.Eng.Sun.COM>
Reply-To: pds@quintus.UUCP (Peter Schachte)
Organization: Quintus Computer Systems, Inc.
Lines: 24

In article <120408@sun.Eng.Sun.COM> cmcmanis@sun.UUCP (Chuck McManis) writes:
[about memory tracking...]
>About the only OS support I can think of
>would be to put the memory on some "well known" list (like tc_MemEntry) 
>so that all of the compiler writers would know where to stick their
>memory allocations to be freed.

Wouldn't it be more general to add to a task (process?) structure an
address to call to clean up when the task exits?  It could be
automatically called by Exit, if it is not 0, or when a task is removed.
This would allow a program to track not only memory, but also locks,
etc.  It would also allow a program to use whatever internal tracking it
needs for its own purposes to clean up after itself.

It might be helpful if the task structure also had a longword allocated
to the program to store data for this purpose.  Then the standard
malloc & friends could chain allocated memory from this pointer and
store a simple chain-from-this-location-Freeing-everything function in
the task's cleanup-function slot.

-- 
-Peter Schachte
pds@quintus.uucp
...!sun!quintus!pds