[M3devel] fewer wrappers/more C? (or a wash?)

hendrik at topoi.pooq.com hendrik at topoi.pooq.com
Mon Apr 20 03:21:29 CEST 2009


On Fri, Apr 17, 2009 at 10:57:10PM +1000, Tony Hosking wrote:
> I am a little concerned about passing REFANY directly to C code as  
> there is no guarantee that REFANY and C pointers will always be  
> compatible.  ADDRESS can more safely be assumed compatible.

Indeed, I once read the X toolkit specs, and it was rife with small 
integers being packed into pointers.  Apparently the toolkit resolved 
it not by a tag bit, but by its magnitude.  There was some constant 
somewhere that identified which numbers were small enough to be 
considered not-pointers.

This was a discrimination without a tag bit.  Similar concept to what 
we're planning for the future of REFANY, but different implementation.

I don't know how they figured out which pointer values were safe to 
treat as integers.

-- hendrik




More information about the M3devel mailing list