aboutsummaryrefslogtreecommitdiff
path: root/lib/std/multi_array_list.zig
AgeCommit message (Collapse)Author
2022-04-29std.MultiArrayList: add functions `addOne`, `pop`, and `popOrNull` (#11553)InKryption
Update basic usage test to account for these, and by extension for addOneAssumeCapacity.
2022-03-24std.MultiArrayList: check size of element, not pointerAndrew Kelley
Ever since a semi-recent language specification update, pointers to zero-sized types still have runtime bits.
2022-03-16gdb: add slice, multi array list, and array hash map printersRobin Voetter
2022-03-14basic language features do not belong in std.metaAndrew Kelley
2022-03-10std: add sort method to ArrayHashMap and MultiArrayListAndrew Kelley
This also adds `std.sort.sortContext` and `std.sort.insertionSortContext` which are more advanced methods that allow overriding the `swap` method. The former calls the latter for now because reworking the main sort implementation is a big task that can be done later without any changes to the API.
2022-01-24Revert "MultiArrayList: Fix error when struct is 0 sized"Andrew Kelley
This reverts commit 1f10cf4edf2b645e63dedc42f5d7475914bf2311. Re-opens #10618 I want to solve this a different way. `align(S)` where S is a 0-byte type should work in this context. This also caused issues such as https://github.com/Vexu/arocc/issues/221
2022-01-24MultiArrayList: Fix error when struct is 0 sizedriverbl
Also fixes error with ArrayHashMap when both key and value are 0 sized
2022-01-17libstd: add smoke test for insert methods in MultiArrayListJakub Konka
2022-01-16Fix missing `!void` in std.MultiArrayListJarred Sumner
Calling `insert` on a `std.MultiArrayList` currently fails with a compiler error due to using a `try` without the `!` annotation on the return type ```zig this.list.insert(allocator, 0, listener); ``` ```zig /Users/jarred/Build/zig/lib/std/multi_array_list.zig:192:13: error: expected type 'void', found '@typeInfo(@typeInfo(@TypeOf(std.multi_array_list.MultiArrayList(src.javascript.jsc.node.types.Listener).ensureUnusedCapacity)).Fn.return_type.?).ErrorUnion.error_set' try self.ensureUnusedCapacity(gpa, 1); ```
2021-11-30allocgate: std Allocator interface refactorLee Cannon
2021-11-30std lib API deprecations for the upcoming 0.9.0 releaseAndrew Kelley
See #3811
2021-10-26multi_array_list: get function take self by valueJonathan Marler
2021-09-19Update all ensureCapacity calls to the relevant non-deprecated versionRyan Liptak
2021-08-24remove redundant license headers from zig standard libraryAndrew Kelley
We already have a LICENSE file that covers the Zig Standard Library. We no longer need to remind everyone that the license is MIT in every single file. Previously this was introduced to clarify the situation for a fork of Zig that made Zig's LICENSE file harder to find, and replaced it with their own license that required annual payments to their company. However that fork now appears to be dead. So there is no need to reinforce the copyright notice in every single file.
2021-06-21fix code broken from previous commitJacob G-W
2021-06-10zig fmtAndrew Kelley
2021-06-03Breaking hash map changes for 0.8.0Martin Wickham
- hash/eql functions moved into a Context object - *Context functions pass an explicit context - *Adapted functions pass specialized keys and contexts - new getPtr() function returns a pointer to value - remove functions renamed to fetchRemove - new remove functions return bool - removeAssertDiscard deleted, use assert(remove(...)) instead - Keys and values are stored in separate arrays - Entry is now {*K, *V}, the new KV is {K, V} - BufSet/BufMap functions renamed to match other set/map types - fixed iterating-while-modifying bug in src/link/C.zig
2021-05-08Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
Conflicts: * doc/langref.html.in * lib/std/enums.zig * lib/std/fmt.zig * lib/std/hash/auto_hash.zig * lib/std/math.zig * lib/std/mem.zig * lib/std/meta.zig * test/behavior/alignof.zig * test/behavior/bitcast.zig * test/behavior/bugs/1421.zig * test/behavior/cast.zig * test/behavior/ptrcast.zig * test/behavior/type_info.zig * test/behavior/vector.zig Master branch added `try` to a bunch of testing function calls, and some lines also had changed how to refer to the native architecture and other `@import("builtin")` stuff.
2021-05-08std: update usage of std.testingVeikka Tuominen
2021-04-19std.MultiArrayList: ensureUnusedCapacity/ensureTotalCapacityAndrew Kelley
Same as c8ae581fef6506a8234cdba1355ba7f0f449031a, but for MultiArrayList.
2021-03-12std: Handle empty MultiArrayList in items()LemonBoy
Closes #8211
2021-03-05std: fix memory leak in MultiArrayListVeikka Tuominen
2021-03-03translate-c: fix c tokenizer giving invalid tokensVeikka Tuominen
2021-02-24MultiArrayList: use @memcpy as a workaroundAndrew Kelley
Reverts bf642204b373e01314ecfb0c50a643dc4b05746f and uses a different workaround, suggested by @LemonBoy. There is either a compiler bug or a design flaw somewhere around here. It does not have to block this branch, but I need to understand exactly what's going on here and make it so that nobody ever has to run into this problem again.
2021-02-23std.MultiArrayList: add workaround for LLVM bugAndrew Kelley
2021-02-05std.MultiArrayList: use `@memset` builtin for undefinedAndrew Kelley
See comment for more details
2021-02-05std.MultiArrayList: implement review commentsIsaac Freund
2021-01-30add std.MultiArrayListAndrew Kelley
Also known as "Struct-Of-Arrays" or "SOA". The purpose of this data structure is to provide a similar API to ArrayList but instead of the element type being a struct, the fields of the struct are in N different arrays, all with the same length and capacity. Having this abstraction means we can put them in the same allocation, avoiding overhead with the allocator. It also saves a tiny bit of overhead from the redundant capacity and length fields, since each struct element shares the same value. This is an alternate implementation to #7854.