0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib/std/multi_array_list.zig
Robbie Lyman 1df1f936b3 feat(MultiArrayList): Pointer Stability
This commit builds on #19523 to add pointer stability to MultiArrayList,
following the lead of the design for HashMap and ArrayList. Since
initializing MultiArrayList with a struct literal is much more common
within the compiler than for ArrayList, I have chosen to make the field
a default init, although I think this is not the best design.

Similar to ArrayList, I have chosen to interpret "pointer stability"
broadly, meaning that existing pointers to (fields of) elements in the
MultiArrayList continue to be valid pointers to the same object. Thus
`appendAssumeCapacity()` does not invalidate pointers, but `pop()` and
`swap()` do.

Closes #19327.
2026-10-09 23:14:28 +02:00

1242 lines
51 KiB