Pointer Stability for ArrayLists (In Zig)

3 pointsposted 10 hours ago
by anitil

1 Comments

anitil

10 hours ago

I just came across an interesting update for Zig, in the direction of supporting a certain class of memory safety. I haven't seen this exact approach before, it seems to be like a limited version of 'const-ability' where you can lock the backing pointers in an ArrayList over a window.

With the addition of 'defer' on the unlock seems not too difficult to use, but I think the main issue I would find it having to remember when and when not to use it.