Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!husc6!bu.edu!bu-cs!dartvax!eleazar.dartmouth.edu!matthews From: matthews@eleazar.dartmouth.edu (Jim Matthews) Newsgroups: comp.sys.mac.programmer Subject: Re: Handles and Virtual Memory Message-ID: <18054@dartvax.Dartmouth.EDU> Date: 29 Dec 89 21:46:49 GMT References: <9415@hoptoad.uucp> <18300010@ux1.cso.uiuc.edu> Sender: news@dartvax.Dartmouth.EDU Organization: Dartmouth College, Hanover, NH Lines: 30 In article <18300010@ux1.cso.uiuc.edu> hirchert@ux1.cso.uiuc.edu writes: >Many of the problems cited stem simply from the fact that there is no way to >tell the compilers to defer dereferencing of a handle until after a system call >or procedure call has taken place. Others would be eliminated if the standard >mechanism for locating objects (especially procedure arguments) were a handle >and displacement rather than a pointer, so that determination of the actual >location of the object could be deferred. I think this would clutter up code as much as the current workarounds. Instead of saying FillRect(r, black) you would say FillRect(rhandle, roffset, bhandle, boffset); And since much of the time you're dealing with stationary data anyway these extra arguments would often be pure overhead. >Complaining about handles as a means of managing storage because of these >problems is a little like complaining about screws as a means of holding >pieces of wood together because it is so hard to hammer them in. The real >problem is that you don't have the right tool for using them. Perhaps the question is why we should set out to invent new kinds of screwdrivers when nails would do the job as well (and we have decades of experience with hammers). With virtual memory most of the rationale for relocatable blocks disappears. It is backwards compatibility, not the advantages of handles, that keeps Apple from revamping the memory manager to match the new reality. I've been programming the Mac for five years and I've learned how to deal with handles. But I would trade that knowledge for a stationary memory scheme in a second. Jim Matthews Dartmouth Software Development