[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SOS. No garbage-collection on exit!



> For the more broken variants of Windows and Mac OS, there are some
> resources that really must be released explicitly. MzScheme/MrEd uses
> something like scheme_add_atexit_closer() to release those resources.
> 

Speaking of garbage collection, what (if any) harm was the
SCHEME_USE_FUEL macro designed to protect against?

I have an extension I'm working on that builds a cons list of data, which
I have to reverse prior to returning to Scheme for things to make sense
to the API user (i.e., the list is cons'ed up in the reverse of what the user
expects.)

Since this is a C extension, I effectively duplicated the "reverse_bang_prim"
code, which I see uses the SCHEME_USE_FUEL macro, which seems to do
some provide some clues to the garbage collector.

Do I need to make the call to "scheme_out_of_fuel" at some point?  The
scheme_fuel_counter seems to be internal to the MzScheme runtime.  But
how can I decrement the value if it's not available remotely?

My own simple testing doesn't show any harm so far, but I worry that if I
start reversing lists of thousands of items I might run into trouble...

Thanks,

-Brent