aboutsummaryrefslogtreecommitdiff
path: root/lib/std/mem.zig
diff options
context:
space:
mode:
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