[M3devel] Re: RTHooks CheckStoreTraced and CheckLoadTraced

Tony Hosking hosking at cs.purdue.edu
Wed Apr 18 16:40:07 CEST 2007


PS You should not use "REF REFANY", since a "REF" is assumed by the  
runtime system to be a *tidy* pointer to an object in the heap.   
Clearly, the address of a field inside an object is by definition  
*untidy*.

On Apr 18, 2007, at 10:34 AM, Tony Hosking wrote:

> I assume you have an apply method for your RTTypeMap.Visitor that  
> takes "field: ADDRESS" and treats it as "REF REFANY".   This is  
> wrong.  When reading a REF field you should use the following idiom:
>
> WITH ref = LOOPHOLE(field, UNTRACED REF REFANY) DO
>   ... access field via ref^ ...
> END;
>
> This will automatically insert a call to the appropriate runtime  
> routines on accessing the reference field.
>
> There should be no need for you to call the runtime routines directly.
>
> On Apr 17, 2007, at 9:51 PM, Darko wrote:
>
>> Hi,
>>
>> Wondering if you can explain the use of these calls a little more.  
>> I'm currently using type maps to read and write fields from traced  
>> objects. Reading a traced reference from inside a traced object  
>> into a local variable is not working as it should. Should I use  
>> CheckLoadTraced and if so when and how? Looking at your changes to  
>> RTTypeMap, writing references into objects means you need to call  
>> CheckStoreTraced on the object written inside of, before it is  
>> written?
>>
>> Cheers,
>> Darko.
>
> _______________________________________________
> M3devel mailing list
> M3devel at elegosoft.com
> https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel




More information about the M3devel mailing list