[futurebasic] Re: [FB] June Challenge: Locking Handles

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2001 : Group Archive : Group : All Groups

From: Chris Stasny <staz@...>
Date: Tue, 12 Jun 2001 09:55:56 -0500
>In the course of working on the new Appearance runtime, a well-known 
>software entrepreneur found it desirable to modify some of my 
>deathless code, by inserting extra lines to lock a handle-block 
>temporarily while a toolbox call (DiffRgn) was made.
>
>The ensuing correspondence revealed three things:  (1) we cannot 
>agree on the need for that change, (2) at least one of us could be 
>described as opinionated (or pig-headed), and (3) the code seems to 
>work with or without the additions.
>
>The June Challenge, then, refers to the lines annotated:
>     ' [ST*Z]
>in the program extracts below.  Are they required for safety?


snip...

Dear Robert,

Oink oink oink. Oink-oink eoinky oink. Oink oinking oink oinker oink 
oink oinkly. Oinker oinks. Oink oink oink. Oink-oink eoinky oink. 
Oink oinking oink oinker oink oink oinkly. Oinker oinks. Oink oink 
oink. Oink-oink eoinky oink. Oink oinking oink oinker oink oink 
oinkly. Oinker oinks.

Translation:

I turned on Mem Heck and put the code into a loop to repeat the 
diffrgn call 1,000 times. I checked the address of the variable 
before and after the diffrgn.

In practice, the call did not move memory. In Think Ref, it says that 
the call may move memory. So I did some more research.

The last parameter is not a variable (as I originally thought) and 
does not receive a region. It is the handle to a region. Therefore, 
it does not matter if the *record* handle moved. The *region* handle 
was already passed as a parameter. You may safely remove the extra 
lines.



Best,

-STAZ  ~)~

800.348.2623 Orders  http://www.stazsoftware.com
228.255.7086 FAX     mailto:staz@...