A weak-reference box object possible?
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!
Afficher les réponses par date
participants (1)
-
Adam