Random idea: A GC'd language where you could manually free objects and they'd get recycled immediately. If you accidentally use them again you get an exception. Implementation uses some sort of generational pointer scheme folded into the read/write barrier.
Conversation
Replying to
ARMv8.5 memory tagging provides a way to enforce memory safety between ~16 generations of allocations in the same address space. Once you go through all the possible tags it's not possible to keep reusing the same address space without confirming the old pointers are gone though.
For compacting GC, could use one tag for active and another for free and skip over the free ones when moving to a new compacted heap. Next time around, increment the tags. Once available tags have run out avoid using that address space again until confirming pointers are gone.
1
Replying to
Yeah, I was thinking once you overflow the tag you just start ignoring the free hints and falling back to regular GC.
1
1
Yeah, thinking through this, because MTE has 16 byte granularity I think this works well. Would love to see this deployed in a language--you could ideally get to "the GC never runs unless the programmer messed up".
1
1
Show replies
