Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!sun-barr!sun!swap!page From: page%swap@Sun.COM (Bob Page) Newsgroups: comp.sys.amiga.tech Subject: Re: Saving (and finding it again) memory Message-ID: <108611@sun.Eng.Sun.COM> Date: 7 Jun 89 17:45:54 GMT References: Sender: news@sun.Eng.Sun.COM Reply-To: page@sun.UUCP (Bob Page) Organization: Sun Microsystems, Mountain View Lines: 16 dwl10@uts.amdahl.com (Dave Lowrey) wrote: > 1. Have a program allocate & initialize some memory > 2. That program exits. > 3. Have another program be able to find that memory. Here's an ugly way to do it - have the program 'mark' the start address someplace. Either a known file name, an environment variable, a known port name, etc. Then have the second task deallocate the memory and remove the 'marker' when it's done with it. Make sure both tasks agree on how much memory is allocated, or allow the second one to find out. Don't use malloc, the C compiler's runtime library will deallocate the memory when you exit. ..bob