Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!lll-crg!nike!cad!ucbvax!jade!ucblapis!oster From: oster@ucblapis.berkeley.edu (David Phillip Oster) Newsgroups: net.micro.mac Subject: Re: >64k code segs. WAS: Aztec C assembler bug? Message-ID: <777@jade.BERKELEY.EDU> Date: Tue, 3-Jun-86 13:11:58 EDT Article-I.D.: jade.777 Posted: Tue Jun 3 13:11:58 1986 Date-Received: Thu, 5-Jun-86 19:29:13 EDT References: <2852@utcsri.UUCP> <759@jade.BERKELEY.EDU> <761@jade.BERKELEY.EDU> <267@comm.UUCP> Sender: usenet@jade.BERKELEY.EDU Reply-To: oster@ucblapis.UUCP (David Phillip Oster) Organization: University of California, Berkeley Lines: 18 Is it that hard to lock all your handles when you dereference them? Well, yes and no. The problem is that: 1) You often give out pointers to fields within handles. Particularly in C where some types are passed by value (Rects) and others by reference (TypeLists) you often give out pointers without having any marker in the source to say you are doing it. 2) If you write programs that use the whole machine, you can't just lock all you handles before you begin and unlock them when you are done -- you'll die of the memory fragmentation. Therefore, it is very important to lock handles when you need them locked, and unlock them again as soon as possible. Segmentation changes the rules for when things need to be locked. This kind of problem is made worse by bad design, but I saw no need to mention in my original posting that one should always do a good design.