aboutsummaryrefslogtreecommitdiff
path: root/lib/std/meta/trailer_flags.zig
AgeCommit message (Collapse)Author
2025-04-13std: eradicate u29 and embrace std.mem.AlignmentAndrew Kelley
2025-01-16all: update to `std.builtin.Type.{Pointer,Array,StructField}` field renamesmlugg
2024-08-28std: update `std.builtin.Type` fields to follow naming conventionsmlugg
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
2024-03-21std: promote tests to doctestsAndrew Kelley
Now these show up as "example usage" in generated documentation.
2024-03-11std.builtin: make container layout fields lowercaseTristan Ross
2024-01-09AstGen: add error for redundant comptime var in comptime scope (#18242)Bogdan Romanyuk
2023-12-08AstGen: add error for using inline loops in comptime only scopesVeikka Tuominen
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-06-17mem: rename align*Generic to mem.align*Motiejus Jakštys
Anecdote 1: The generic version is way more popular than the non-generic one in Zig codebase: git grep -w alignForward | wc -l 56 git grep -w alignForwardGeneric | wc -l 149 git grep -w alignBackward | wc -l 6 git grep -w alignBackwardGeneric | wc -l 15 Anecdote 2: In my project (turbonss) that does much arithmetic and alignment I exclusively use the Generic functions. Anecdote 3: we used only the Generic versions in the Macho Man's linker workshop.
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-11-29std.mem.Allocator: allow shrink to failAndrew Kelley
closes #13535
2022-05-04std.meta.TrailerFlags: improve init typeErik Arvstedt
2022-05-04std.meta.TrailerFlags: include in std testsErik Arvstedt
Previously, TrailerFlags was unreferenced in std, so its tests were never run. Also, fix the use of `default_value` whose type was changed in f4a249325e8e3741a6294462ae37a79cb9089c56 (#10766).
2022-03-08deprecated TypeInfo in favor of TypeJonathan Marler
Co-authored-by: Veikka Tuominen <git@vexu.eu>
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.TrailerFlags: remove superfluous parameterAndrew Kelley
2021-06-21fix code broken from previous commitJacob G-W
2021-05-08std: update usage of std.testingVeikka Tuominen
2021-01-30Replace @TagType uses, mostly with std.meta.TagTadeo Kondrak
2021-01-01std: loop in trailer flags can be indexing operationdaurnimator
2021-01-01std: use FieldEnum from TrailerFlagsdaurnimator
2020-12-31Year++Frank Denis
2020-10-17Make std.meta.Int accept a signedness parameterJan Prudil
2020-10-01Add alignment field to TypeInfo.UnionField and TypeInfo.StructFieldTadeo Kondrak
Closes https://github.com/ziglang/zig/issues/6122
2020-09-02builtin: Add TypeInfo.StructField.is_comptimeTadeo Kondrak
2020-08-27std.meta.TrailerFlags fixesTadeo Kondrak
2020-08-27std.meta.TrailerFlags: use @Type to improve APITadeo Kondrak
- Use an enum of all field names instead of string literals - Create a struct type with all fields optional instead of relying on anonymous struct literals This should provide better type inference, compile errors, and a (subjectively) cleaner API.
2020-08-20add license header to all std lib filesAndrew Kelley
add SPDX license identifier copyright ownership is zig contributors
2020-07-15TrailerFlags test: fix bad alignment assumption on 32-bitAndrew Kelley
2020-07-15stage2: VarDecl and FnProto take advantage of TrailerFlags APIAndrew Kelley
These AST nodes now have a flags field and then a bunch of optional trailing objects. The end result is lower memory usage and consequently better performance. This is part of an ongoing effort to reduce the amount of memory parsed ASTs take up. Running `zig fmt` on the std lib: * cache-misses: 2,554,321 => 2,534,745 * instructions: 3,293,220,119 => 3,302,479,874 * peak memory: 74.0 MiB => 73.0 MiB Holding the entire std lib AST in memory at the same time: 93.9 MiB => 88.5 MiB
2020-07-14add std.meta.TrailerFlags APIAndrew Kelley
This is useful for saving memory when allocating an object that has many optional components. The optional objects are allocated sequentially in memory, and a single integer is used to represent each optional object and whether it is present based on each corresponding bit.