Alex Queiroz <asandroq@gmail.com> writes:
On Tue, Apr 5, 2011 at 2:23 AM, Diogo F. S. Ramos <diogofsr@gmail.com> wrote:
I was looking around the examples from the distribution and I found (##still-copy), which made my code work, but I don't know why, and I couldn't find any mention of it inside the manual.
Gambit uses a copying garbage collector, and therefore move objects in memory. ##STILL-COPY copies the object to a memory location from where it won't be moved again. So I guess a garbage collection is happening after the call to MAKE_BOOK.
I see. Nice. Is this the right way to do it? I mean, whenever I create a scheme object that I want to return to C code, but I don't want to make a conversion to a C type like a struct because I only access its values using accessors, should I call (##still-copy) when returning it? -- Diogo F. S. Ramos