[M3devel] Re: RTHooks CheckStoreTraced and CheckLoadTraced

Darko darko at darko.org
Thu Apr 19 03:37:10 CEST 2007


Not actually using that code, but I did see your helpful commit on it  
some time ago. It seems that the problem I described earlier is due  
to another bug. The code I'm working on does a lot of reading and  
writing of traced references and I was hoping to get a better  
understanding of situations I need to be aware of and how to use  
those RTHooks calls more efficiently.

So say I have two traced objects and I am copying a traced reference  
from a field in one to the other. What set of calls would be normally  
required there?

I'm sure you haven't got time to go into the minutiae of the runtime  
system, but any hints would be appreciated.

Cheers,
Darko.


On 18/04/2007, at 4:34 PM, 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.
>




More information about the M3devel mailing list