Pointer Stability for ArrayLists (In Zig)

(ziglang.org)

3 points | by anitil 10 hours ago ago

1 comments

  • anitil 10 hours ago 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.