[gambit-list] References between 'foreign' objects.

Estevo euccastro at yahoo.com
Sat Mar 24 21:02:10 EDT 2012


> This reminds me that Gambit provides a memory allocation function, ___alloc_rc, 

> for allocating C objects on the C heap which have a back-pointer to a Scheme 
> object, and also a reference count.  The API is:
> 
> void *___alloc_rc(unsigned long n);
> void ___release_rc(void *ptr);
> void ___addref_rc(void *ptr);
> void ___set_data_rc(void *ptr, ___SCMOBJ val);
> ___SCMOBJ ___data_rc(void *ptr);

This might be just what I need, thanks!  Paradoxically enough, I was allocating my structs with ___alloc_rc, but I don't think I really understood how that works.

I'll ping the list when I have something that I believe is solid, and/or I'll put it in the dumping grounds, just in case it might be of use for anyone else.

Thanks again,

Estevo.




More information about the Gambit-list mailing list