Marc you wrote 2 pieces of code:
- a heap walker: ##walk-object!
- a function to copy recursively an object to a new memory zone (STILL, PERMANENT, ...): ##copy-object
you also wrote a small test function: test-walk at the end of the file to showcase those
The goal for me was to move large pieces of stable memory (classes for example) to PERMANENT memory so as to diminish the pressure on the garbage collector in the video game I'm writing. I ended up not using it in the game as I was never able to make it work correctly due to the complexities of the structures I wanted to copy.
The implementation is available here:
https://github.com/jazzscheme/jazz/blob/master/lib/gambit.walk/src/gambit/walk/implementation.scm. Dimitri, just remove the surrounding (unit protected gambit.walk.implementation ...) expression to get pure Gambit code.
Note that Gambit 4.8.8 broke some pieces of the code. See the ;; fix gambit 4.8.8 undefined warnings comments throughout the code (should not be too hard to fix I think).
Guillaume