Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!samsung!think!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.object Subject: Re: Garbage collection Keywords: Garbage collection, object management Message-ID: <34484@news.Think.COM> Date: 6 Mar 90 07:01:03 GMT References: <52045@microsoft.UUCP> <25f324e9.1488@polyslo.CalPoly.EDU> Sender: news@Think.COM Reply-To: barmar@nugodot.think.com.UUCP (Barry Margolin) Distribution: usa Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 18 In article <25f324e9.1488@polyslo.CalPoly.EDU> ttwang@polyslo.CalPoly.EDU (Thomas Wang) writes: > If the language would access things through >handles, then a portable GC can be written with good enough performance for >it to be useful. At the expense of doubling the number of memory references for every pointer dereference. The Macintosh system has a reasonable compromise. They encourage use of handles, but provide a LockHandle function. You lock a handle around a section of code that uses that pointer extensively (e.g. an inner loop), and only dereference the handle once, right after the lock. If a GC happens during that section of code the locked object won't be moved. -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar