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="gmail_quote">Den 25 mars 2012 04:02 skrev Estevo <span dir="ltr"><<a href="mailto:euccastro@yahoo.com">euccastro@yahoo.com</a>></span>:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">> 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="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Gambit-list mailing list<br>
<a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
<a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
</div></div></blockquote></div><br>