aboutsummaryrefslogtreecommitdiff
path: root/lib/std/multi_array_list.zig
AgeCommit message (Collapse)Author
2024-07-07InternPool: implement and use thread-safe list for stringsJacob Young
2024-03-11std.builtin: make container layout fields lowercaseTristan Ross
2024-03-01compiler: audit debug mode checksJacob Young
* Introduce `-Ddebug-extensions` for enabling compiler debug helpers * Replace safety mode checks with `std.debug.runtime_safety` * Replace debugger helper checks with `!builtin.strip_debug_info` Sometimes, you just have to debug optimized compilers...
2024-01-03Correct expected/actual parameter order of some assertionsCarl Åstholm
2024-01-03Fix compile errors from the `expectEqual` changeCarl Åstholm
2023-11-04x86_64: fix miscompilationsJacob Young
Closes #17618
2023-10-23x86_64: implement enough to pass unicode testsJacob Young
* implement vector comparison * implement reduce for bool vectors * fix `@memcpy` bug * enable passing std tests
2023-10-22Revert "Revert "Merge pull request #17637 from jacobly0/x86_64-test-std""Jacob Young
This reverts commit 6f0198cadbe29294f2bf3153a27beebd64377566.
2023-10-22Revert "Merge pull request #17637 from jacobly0/x86_64-test-std"Andrew Kelley
This reverts commit 0c99ba1eab63865592bb084feb271cd4e4b0357e, reversing changes made to 5f92b070bf284f1493b1b5d433dd3adde2f46727. This caused a CI failure when it landed in master branch due to a 128-bit `@byteSwap` in std.mem.
2023-10-21x86_64: fix bugs and disable erroring testsJacob Young
2023-10-08std: add unstable sorting to array hash mapsAndrew Kelley
closes #17426
2023-09-24std.MultiArrayList: add test coverage for 0-bit structsAndrew Kelley
closes #10618 solved by #17172
2023-07-11Add more sorting functions to MultiArrayList (#16377)Niles Salter
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2023-06-19all: zig fmt and rename "@XToY" to "@YFromX"Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-05-29Prevent analysis of functions only referenced at comptimemlugg
The idea here is that there are two ways we can reference a function at runtime: * Through a direct call, i.e. where the function is comptime-known * Through a function pointer This means we can easily perform a form of rudimentary escape analysis on functions. If we ever see a `decl_ref` or `ref` of a function, we have a function pointer, which could "leak" into runtime code, so we emit the function; but for a plain `decl_val`, there's no need to. This change means that `comptime { _ = f; }` no longer forces a function to be emitted, which was used for some things (mainly tests). These use sites have been replaced with `_ = &f;`, which still triggers analysis of the function body, since you're taking a pointer to the function. Resolves: #6256 Resolves: #15353
2023-05-23std.sort: add pdqsort and heapsortAli Chraghi
2023-04-28update codebase to use `@memset` and `@memcpy`Andrew Kelley
2023-04-25change semantics of `@memcpy` and `@memset`Andrew Kelley
Now they use slices or array pointers with any element type instead of requiring byte pointers. This is a breaking enhancement to the language. The safety check for overlapping pointers will be implemented in a future commit. closes #14040
2023-04-16Removing duplicate word in docBogdan Romanyuk
2023-04-10std.MultiArrayList: add support for tagged unions.GethDW
2023-03-27std.MultiArrayList: add set and get to SliceJacob Young
2023-03-06tools: add lldb pretty printer for std.MultiArrayList.SliceJacob Young
2023-02-27tools: implement more lldb pretty printersJacob Young
2023-02-21MultiArrayList: delete pessimizing vector usageJacob Young
By factoring out the comptime parts of this computation, vectors are no longer useful in this function.
2023-02-18update std lib and compiler sources to new for loop syntaxAndrew Kelley
2022-12-17std.builtin: rename Type.UnionField and Type.StructField's field_type to typer00ster91
2022-12-06remove most conditional compilation based on stage1Andrew Kelley
There are still a few occurrences of "stage1" in the standard library and self-hosted compiler source, however, these instances need a bit more careful inspection to ensure no breakage.
2022-11-29std.mem.Allocator: allow shrink to failAndrew Kelley
closes #13535
2022-11-01std: avoid vector usage with the C backendJacob Young
Vectors are not yet implemented in the C backend, so no reason to prevent code using the standard library from compiling in the meantime.
2022-09-16std: remove deprecated API for the upcoming releaseAndrew Kelley
See #3811
2022-09-13std: remove workaround for fixed bugAndrew Kelley
The miscompilation in question has been fixed upstream in LLVM 13. closes #8117
2022-08-27Sema: add error for non-comptime param in comptime funcantlilja
Adds error for taking a non comptime parameter in a function returning a comptime-only type but not when that type is dependent on a parameter. Co-authored-by: Veikka Tuominen <git@vexu.eu>
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