[gambit-list] A weak-reference box object possible?

Adam adam.mlmb at gmail.com
Sun Jun 11 05:00:20 EDT 2017


Hi Marc,

I realize that Gambit delivers weak references only through hashtables and
will objects.

I suspect a weakly referenced box, i.e. a will object without action, would
be useful.

Do will objects have any overhead due to the action.. I would guess so, or
is it so small that users implementing a weakly referenced box themselves
by (define (make-weak-box v) (make-will v (lambda (v) #!void))), would
always be a clean solution?


I recall that will objects take extra time during some GC phase, actually
extend the STW, so that's part why I wanted to ask this question.

Also I brought this up as the absence of a "simple" weak reference box
object appeared a bit assymetric to me, e.g., what about the cases where
you want an object reference but want it to be weak, and are fine with it
becoming #!void or #f or #!undefined or alike when collected.


Any comments would be much welcome. Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20170611/b42d8eba/attachment.htm>


More information about the Gambit-list mailing list