aboutsummaryrefslogtreecommitdiff
path: root/lib/std/mem.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-03-04 18:23:11 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-03-04 18:23:11 -0700
commitbccef441963434b452a623abbb9315fd92c1e255 (patch)
tree4c0ea89b8fa895b3d34749ec089e45438d79466b /lib/std/mem.zig
parent0c06a1885fad9a9bb85342632a0b7c8a3a0733e9 (diff)
parent041212a41cfaf029dc3eb9740467b721c76f406c (diff)
downloadzig-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.zig8
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