[gambit-list] Any procedure/debug way to see what objects reference an object?

Mikael mikael.rcv at gmail.com
Tue Jun 18 14:12:28 EDT 2013


2013/6/18 Mikael <mikael.rcv at gmail.com>

>
> So something is invalid about doing what I did in the printf above, which
> should correspond to
>
> ___SCMOBJ newref = (reference_location == IN_OBJECT) ? ((int*)
> container_body) : ___FAL;
>
>
> Em. The ___SCMOBJ *is* the new location, isn't it, so this should have
> worked -
>
> What did I miss, how is this done correctly?
>
>
Aah right - container_body needs to be given the proper header tag in order
to be a ___SCMOBJ. So to get it:

When reference_location == IN_OBJECT , to container_body, I need to add an
object type mask based on ___HD_WORDS(head) and ___HD_SUBTYPE(head) where
head = container_body[-1] .

This would be done by applying on container_body, depending on its type:

 * If fixnum:    << ___TB + ___tFIXNUM

 * If special object (#f etc.): << ___TB +  ___tSPECIAL

 * If pair: << ___TB + ___tPAIR

 * If other type:  How, there's some macros like __BODY , would any of
those be of use?

Also would there be some macro for the fixnum/special/pair cases?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20130618/9d06b136/attachment.htm>


More information about the Gambit-list mailing list