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

Estevo euccastro at yahoo.com
Mon Mar 26 10:59:41 EDT 2012


I'll make sure to, as soon as I'm confident I'm doing it right.




>________________________________
> De: Mikael <mikael.rcv at gmail.com>
>Para: gambit-list at iro.umontreal.ca; euccastro at yahoo.com 
>Enviadas: Segunda-feira, 26 de Março de 2012 6:03
>Assunto: Re: [gambit-list] References between 'foreign' objects.
> 
>
>Estevo, if this delivered for you, please remember to document this mechanism (___alloc_rc and the others) in the Wiki so it'll be clear also for others. Mikael
>
>
>Den 25 mars 2012 04:02 skrev Estevo <euccastro at yahoo.com>:
>
>> 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.
>>
>>
>>_______________________________________________
>>Gambit-list mailing list
>>Gambit-list at iro.umontreal.ca
>>https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20120326/29e07f53/attachment.htm>


More information about the Gambit-list mailing list