<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div><span>I'll make sure to, as soon as I'm confident I'm doing it right.<br></span></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"> <div style="font-family: Courier New, courier, monaco, monospace, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight:bold;">De:</span></b> Mikael <mikael.rcv@gmail.com><br> <b><span style="font-weight: bold;">Para:</span></b> gambit-list@iro.umontreal.ca; euccastro@yahoo.com <br> <b><span style="font-weight: bold;">Enviadas:</span></b> Segunda-feira, 26 de Março de 2012 6:03<br> <b><span style="font-weight: bold;">Assunto:</span></b> Re:
[gambit-list] References between 'foreign' objects.<br> </font> </div> <br><div id="yiv1652178372">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<br><br><div class="yiv1652178372gmail_quote">Den 25 mars 2012 04:02 skrev Estevo <span dir="ltr"><<a rel="nofollow" ymailto="mailto:euccastro@yahoo.com" target="_blank" href="mailto:euccastro@yahoo.com">euccastro@yahoo.com</a>></span>:<br>
<blockquote class="yiv1652178372gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="yiv1652178372im">> This reminds me that Gambit provides a memory allocation function, ___alloc_rc,<br>
<br>
> for allocating C objects on the C heap which have a back-pointer to a Scheme<br>
> object, and also a reference count. The API is:<br>
><br>
> void *___alloc_rc(unsigned long n);<br>
> void ___release_rc(void *ptr);<br>
> void ___addref_rc(void *ptr);<br>
> void ___set_data_rc(void *ptr, ___SCMOBJ val);<br>
> ___SCMOBJ ___data_rc(void *ptr);<br>
<br>
</div>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.<br>
<br>
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.<br>
<br>
Thanks again,<br>
<br>
Estevo.<br>
<div class="yiv1652178372HOEnZb"><div class="yiv1652178372h5"><br>
_______________________________________________<br>
Gambit-list mailing list<br>
<a rel="nofollow" ymailto="mailto:Gambit-list@iro.umontreal.ca" target="_blank" href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
<a rel="nofollow" target="_blank" href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
</div></div></blockquote></div><br>
</div><br><br> </div> </div> </blockquote></div> </div></body></html>