I wanted to experiment a plugin and need to register a couple of classes that some primitive will test/instantiate. The ugly way is to pollute specialObjectArray... But #recreateSpecialObjectsArray recommend using addGCRoot() Fine, I'd like to try.
What I'd like to do is register my couple of classes in a primRegister() primitive (once for all or at each image startup, or at each snapshot, whatever...) Then to later use the registered classes in primDoSomething().
I can see ObjectMemory>>addGCRoot: but unfortunately, absolutely no sender of it to serve as an example... I even don't know how to access the objectMemory from within a SmartSyntaxInterpreterPlugin ? I can only see a interpreterProxy and
Then how to retrieve my registered objects? they are store in the extraRoots at some index, but that index is not returned by addGCRoot:... Anyway, the index could change thanks to removeGCRoot:, so I'm stuck here... I must be missing something... Or maybe addGCRoot: is just here to prevent an Object to be garbage collected but does not really offer a registering service...
If you know about any documentation/example hanging around or have some clues I'll be happy that you share them !
Last note, I'm in a VMMaker oscog flavour...
Nicolas