Hacker News new | ask | show | jobs
by socmag 3353 days ago
When you say pointers, do you actually mean pointers?

I've implemented something like you describe before in a game engine for a managed language.

Instead of using pointers though I used integers throughout.

The actual state was maintained in a flat vector of element blocks and were stable.

The nice thing about integers on a GC'd platform are that they are opaque to the GC so zero time was spent on pointer chasing.

The other nice thing is you could literally dump the entire state to disk or restore pretty much in one go.

Looks good though, and I agree (as you mention further down) that state can often be part of multiple list/trees simultaneously, so it makes better sense to keep them separate.