Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Memory, what *REALLY* will relocate/purge heap? Keywords: Memory, heap zone Message-ID: <9439@hoptoad.uucp> Date: 30 Dec 89 22:51:21 GMT References: <5847@sdcc6.ucsd.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 23 In article <5847@sdcc6.ucsd.edu> ma199at@sdcc6.ucsd.edu (L J Cris) writes: >Can someone explain to me why DisposHandle, DisposPtr or >SndDisposeChannel and many other dispose routines would scramble/purge >the heap? > >All they do is deallocate memory, don't they? Other than the memory >you want to release, what else would be affected? That's probably correct, but what the list is really about is "routines you can't call at interrupt time". Because the heap data structures might be in mid-revision when an interrupt is invoked, it would be unsafe to call these rouines during an interrupt. Perhaps a better course would have been for Apple to distinguish between routines that may cause relocation and routines which can't be called at interrupt time, but since they merged the two lists (and the former is a subset of the latter) you can't count on handles remaining still even when routines like DisposPtr are called. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "Next prefers its X and T capitalized. We'd prefer our name in lights in Vegas." -- Louis Trager, San Francisco Examiner