mirror of
https://codeberg.org/ziglang/zig
synced 2026-11-18 07:05:05 +00:00
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.
1242 lines
51 KiB
1242 lines
51 KiB