Skip to content

Mitigation of #15108 in std.heap.page_size_min #23043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

rpkak
Copy link
Contributor

@rpkak rpkak commented Mar 2, 2025

If root.std_options.page_size_min is not null accessing std.heap.page_size_min results in the error described in #15108.

const std = @import("std");

pub const std_options: std.Options = .{
    .page_size_min = 4096,
};

comptime {
    @compileLog(std.heap.page_size_min);
}
$ zig build-obj test.zig
/home/user/zig/0.14.0-dev.3445+6c3cbb0c8/files/lib/std/heap.zig:45:89: error: expected optional type, found 'usize'
pub const page_size_min: usize = std.options.page_size_min orelse page_size_min_default orelse
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~

This was introduced in #22488.

See also: Discord zig-help link

@alexrp alexrp enabled auto-merge (rebase) March 2, 2025 16:23
@alexrp alexrp merged commit 0367d68 into ziglang:master Mar 2, 2025
9 checks passed
@rpkak rpkak deleted the mitigate-15108-in-std.heap.page_size_min branch March 2, 2025 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants