Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Integer Size problem Message-ID: <8377@hoptoad.uucp> Date: 24 Aug 89 01:16:47 GMT References: <15141@dartvax.Dartmouth.EDU> <11689@cit-vax.Caltech.Edu> <1465@draken.nada.kth.se> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 30 In article <11689@cit-vax.Caltech.Edu> palmer@tybalt.caltech.edu.UUCP (David Palmer) writes: >A better way, clearer and probably faster, however is to just do: > **(rect **)myHandle = myRect; >You don't have to lock anything down, it is a single easy to understand In article <1465@draken.nada.kth.se> d88-jwa@nada.kth.se (Jon W{tte) writes: >Wrong. Incorrect. What happens if a interrupt happens between the set >pointers and the block move instruction ? And this interrupt happens >to shuffle memory ? LOCK THE HANDLES first ! ALWAYS ! Wrong. Incorrect. Interrupts are forbidden to shuffle memory. Lock handles only when you need to; you risk fragmenting the heap otherwise. >> **myhandle.boundrect = myRect; >> /* ^ or whatever the element name is */ > >Both Inside Mac and the TechNotes tell us no to change any fields in >windows or GrafPorts directly. But since everybody's doing it, they >won't DARE change anything :-) So? He's not changing anything in a window or graphics port, he's changing something in a window template resource. If the difference isn't clear to you, I recommend re-reading the Window Manager chapter of Inside Mac. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "The time is gone, the song is over. Thought I'd something more to say." - Roger Waters, Time