[usocket-devel] Re: What if a usocket instance be garbage collected?
Tobias C. Rittweiler
tcr at freebits.de
Wed Oct 1 12:47:13 UTC 2008
"Erik Huelsmann" writes:
> > In Lisp, automatic resource deallocation is most often done in the
> > cleanup clauses of an UNWIND-PROTECT that's nicely abstracted in some
> > WITH-FOO macro.
>
> Yes, however, from the point of view of the library, this can't be
> guaranteed. If the library can make sure the resources will be
> de-allocated, I'm of the opinion it should.
I think it's reasonable for the library to hook into the garbage
collector, and warn about garbage-collected but not yet closed external
ressources (and close them, incidentally.)
It should, however, not try to make the user think that relying on the
GC for closing external ressources is a good design choice.
-T.
More information about the usocket-devel
mailing list