aboutsummaryrefslogtreecommitdiff
path: root/lib/std/linked_list.zig
AgeCommit message (Collapse)Author
2022-09-11chore: Remove unused constantsShane Kennedy
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-21std: fix code unblocked by previous commitJacob G-W
2021-06-21fix code broken from previous commitJacob G-W
2021-06-21std, src, doc, test: remove unused variablesJacob G-W
2021-05-08std: update usage of std.testingVeikka Tuominen
2021-01-04Fix off-by-one error in SinglyLinkedList.len() and add associated testsJ.C. Moyer
2020-12-31Year++Frank Denis
2020-08-22std: remove init functions from linked list nodesIsaac Freund
These functions are rather useless and redundant as initializing the struct directly is just as easy: var node = TailQueue(u32).Node{ .data = 42 };
2020-08-21std: sync TailQueue with new SinglyLinkedList APIIsaac Freund
The API of SinglyLinkedList was changed in 93384f7, removing the init function as well as the redundant allocation helper functions. This commit makes parallel changes to the API of TailQueue in order to keep the standard library consistent.
2020-08-20add license header to all std lib filesAndrew Kelley
add SPDX license identifier copyright ownership is zig contributors
2020-05-24run zig fmt on std libAndrew Kelley
2020-05-23std: update singly linked list tests to new APIAndrew Kelley
2020-05-20golly jeepers it's taking a long time to update translate-cAndrew Kelley
2020-05-19use singly linked lists for std.zig.parseAndrew Kelley
std.ast uses a singly linked list for lists of things. This is a breaking change to the self-hosted parser API. std.ast.Tree has been separated into a private "Parser" type which represents in-progress parsing, and std.ast.Tree which has only "output" data. This means cleaner, but breaking, API for parse results. Specifically, `tokens` and `errors` are no longer SegmentedList but a slice. The way to iterate over AST nodes has necessarily changed since lists of nodes are now singly linked lists rather than SegmentedList. From these changes, I observe the following on the self-hosted-parser benchmark from ziglang/gotta-go-fast: throughput: 45.6 MiB/s => 55.6 MiB/s maxrss: 359 KB => 342 KB This commit breaks the build; more updates are necessary to fix API usage of the self-hosted parser.
2020-05-10rework self-hosted compiler for incremental buildsAndrew Kelley
* introduce std.ArrayListUnmanaged for when you have the allocator stored elsewhere * move std.heap.ArenaAllocator implementation to its own file. extract the main state into std.heap.ArenaAllocator.State, which can be stored as an alternative to storing the entire ArenaAllocator, saving 24 bytes per ArenaAllocator on 64 bit targets. * std.LinkedList.Node pointer field now defaults to being null initialized. * Rework self-hosted compiler Package API * Delete almost all the bitrotted self-hosted compiler code. The only bit rotted code left is in main.zig and compilation.zig * Add call instruction to ZIR * self-hosted compiler ir API and link API are reworked to support a long-running compiler that incrementally updates declarations * Introduce the concept of scopes to ZIR semantic analysis * ZIR text format supports referencing named decls that are declared later in the file * Figure out how memory management works for the long-running compiler and incremental compilation. The main roots are top level declarations. There is a table of decls. The key is a cryptographic hash of the fully qualified decl name. Each decl has an arena allocator where all of the memory related to that decl is stored. Each code block has its own arena allocator for the lifetime of the block. Values that want to survive when going out of scope in a block must get copied into the outer block. Finally, values must get copied into the Decl arena to be long-lived. * Delete the unused MemoryCell struct. Instead, comptime pointers are based on references to Decl structs. * Figure out how caching works. Each Decl will store a set of other Decls which must be recompiled when it changes. This branch is still work-in-progress; this commit breaks the build.
2020-02-06more std lib async I/O integrationAndrew Kelley
* `zig test` gainst `--test-evented-io` parameter and gains the ability to seamlessly run async tests. * `std.ChildProcess` opens its child process pipe with O_NONBLOCK when using evented I/O * `std.io.getStdErr()` gives a File that is blocking even in evented I/O mode. * Delete `std.event.fs`. The functionality is now merged into `std.fs` and async file system access (using a dedicated thread) is automatically handled. * `std.fs.File` can be configured to specify whether its handle is expected to block, and whether that is OK to block even when in async I/O mode. This makes async I/O work correctly for e.g. the file system as well as network. * `std.fs.File` has some deprecated functions removed. * Missing readv,writev,pread,pwrite,preadv,pwritev functions are added to `std.os` and `std.fs.File`. They are all integrated with async I/O. * `std.fs.Watch` is still bit rotted and needs to be audited in light of the new async/await syntax. * `std.io.OutStream` integrates with async I/O * linked list nodes in the std lib have default `null` values for `prev` and `next`. * Windows async I/O integration is enabled for reading/writing file handles. * Added `std.os.mode_t`. Integer sizes need to be audited. * Fixed #4403 which was causing compiler to crash. This is working towards: ./zig test ../test/stage1/behavior.zig --test-evented-io Which does not successfully build yet. I'd like to enable behavioral tests and std lib tests with --test-evented-io in the test matrix in the future, to prevent regressions.
2020-01-29Promoted "leak_count_allocator" to the main testing.allocatorBenjamin Feng
2020-01-29Create leak_count_allocatorBenjamin Feng
2020-01-29Move debug.global_allocator to testing.allocatorBenjamin Feng
2019-09-25mv std/ lib/Andrew Kelley
that's all this commit does. further commits will fix cli flags and such. see #2221