diff options
Diffstat (limited to 'src/layout.zig')
| -rw-r--r-- | src/layout.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/layout.zig b/src/layout.zig index d61ebf3..b3c6520 100644 --- a/src/layout.zig +++ b/src/layout.zig @@ -22,8 +22,9 @@ const std = @import("std"); const abi = @import("abi.zig"); -/// The most a State may be, in bytes: a save holds at most 64 MiB. -pub const max_state = 64 << 20; +/// The most a State may be, in bytes: half of the 64 MiB a save holds, so +/// history has room (Sessions.max_save). +pub const max_state = 32 << 20; pub fn of(comptime T: type, comptime memory: abi.Memory) abi.Layout { return comptime blk: { @@ -31,7 +32,7 @@ pub fn of(comptime T: type, comptime memory: abi.Memory) abi.Layout { switch (memory) { .state => { check(T, @typeName(T)); - if (@sizeOf(T) > max_state) @compileError(std.fmt.comptimePrint("State is {d} bytes, and a save holds at most {d} MiB: lower a capacity (an array, an sk.List), or keep what need not be saved in Session.", .{ @sizeOf(T), max_state >> 20 })); + if (@sizeOf(T) > max_state) @compileError(std.fmt.comptimePrint("State is {d} bytes, and may be {d} MiB, half of a save, so history has room: lower a capacity (an array, an sk.List), or keep what need not be saved in Session.", .{ @sizeOf(T), max_state >> 20 })); }, .session => {}, } |
