Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!sun-barr!ames!eos!shelby!portia!Jessica!duggie From: duggie@Jessica.stanford.edu (Doug Felt) Newsgroups: comp.sys.mac.programmer Subject: Re: Stale Pointers Keywords: Lightspeed C Message-ID: <3232@portia.Stanford.EDU> Date: 29 Jun 89 02:48:47 GMT References: <2394@ur-cc.UUCP> <27101@coherent.com> Sender: USENET News System Reply-To: duggie@Jessica.UUCP (Doug Felt) Distribution: usa Organization: Stanford University Lines: 16 Others have pointed out that C does not specify the order of evaluation in an assignment; I just thought I'd mention the related gotcha that calls of functions in other segments can cause memory compaction as well. Especially since one may change the segmentation scheme in the process of tuning a program, it's a good idea to never use dereferenced handles in function calls, either as parameters or to get the function result, without locking them (or using temporaries). (This problem shows up often in Object Pascal as well, where the notational convenience of being able to use 'object.foo' instead of 'object^^.foo' leads one to forget that dereferencing is taking place. Of course, with Pascal you aren't supposed to know...) Doug Felt Courseware Authoring Tools Project duggie@jessica.stanford.edu