diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-03-04 18:23:11 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-03-04 18:23:11 -0700 |
| commit | bccef441963434b452a623abbb9315fd92c1e255 (patch) | |
| tree | 4c0ea89b8fa895b3d34749ec089e45438d79466b /lib/std/mem.zig | |
| parent | 0c06a1885fad9a9bb85342632a0b7c8a3a0733e9 (diff) | |
| parent | 041212a41cfaf029dc3eb9740467b721c76f406c (diff) | |
| download | zig-bccef441963434b452a623abbb9315fd92c1e255.tar.gz zig-bccef441963434b452a623abbb9315fd92c1e255.zip | |
Merge remote-tracking branch 'origin/master' into llvm12
Syncing with master branch because I want to re-run
update_clang_options.zig in the llvm12 branch.
Diffstat (limited to 'lib/std/mem.zig')
| -rw-r--r-- | lib/std/mem.zig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/std/mem.zig b/lib/std/mem.zig index 5f23a10401..581fb16e6c 100644 --- a/lib/std/mem.zig +++ b/lib/std/mem.zig @@ -25,6 +25,14 @@ pub const page_size = switch (builtin.arch) { else => 4 * 1024, }; +/// The standard library currently thoroughly depends on byte size +/// being 8 bits. (see the use of u8 throughout allocation code as +/// the "byte" type.) Code which depends on this can reference this +/// declaration. If we ever try to port the standard library to a +/// non-8-bit-byte platform, this will allow us to search for things +/// which need to be updated. +pub const byte_size_in_bits = 8; + pub const Allocator = @import("mem/Allocator.zig"); /// Detects and asserts if the std.mem.Allocator interface is violated by the caller |
