Comment 3 for bug 1903413

Douglas Katzman (dougk) wrote :

Two problems:
1. there a billion other things going on aside from the classoid. The anonymous class is a direct-subclass of standard-object. Are classes allowed to remove unreferenced subclasses? (Is this specified behavior? That direct subclasses are weakly referenced?)

* (let ((so (find-class'standard-object))) (print (length (sb-mop:class-direct-subclasses so))) (make-instance 'standard-class) (print (length (sb-mop:class-direct-subclasses so))))
5
6

2. it is virtually impossible to guarantee that something in the MOP has not put your object into a cache of some kind, especially as it is a metaobject. If make-instance on all metaobjects were forced to completely flush all caches in the system, maybe there would be a chance of "fixing" this issue.

Also, generally speaking:
- no new objects ever go into static space, barring some trampolines for alien-lambda
- it's very difficult to get good answers from traceroot where weakness is involved. Pretty much anything it does is going to be wrong. If you assume that weak structures may _not_ participate in any path, then it'll miss some paths. If you assume that they _may_ participate, then it'll act like falsely enlivening the object, not being truly "weak". But if some object that is a-priori alive enlivens a k/v pair in a weak table which makes the path valid, that should be fine. Except that this is beyond the scope of anything I want to solve.