Skip to content

Fix std.heap.pageSize() not being comptime-known - #72

Open
QSmally wants to merge 1 commit into
jetzig-framework:mainfrom
QSmally:fix-pagesize
Open

Fix std.heap.pageSize() not being comptime-known#72
QSmally wants to merge 1 commit into
jetzig-framework:mainfrom
QSmally:fix-pagesize

Conversation

@QSmally

@QSmally QSmally commented Jul 16, 2026

Copy link
Copy Markdown

With some targets, e.g. tested with aarch64-linux-musl, std.heap.pageSize() is not comptime-known in compiler version 0.16.0 and therefore returns an error:

zig-pkg/zmpl-0.0.1-SYFGBq-yAwCLE5V8niLARi8eny-pM3FuzEQ18yhcX7jo/src/zmpl/debug.zig:125:32: note: called at comptime from here
    var buf: [std.heap.pageSize()]u8 = undefined;
              ~~~~~~~~~~~~~~~~~^~
zig-pkg/zmpl-0.0.1-SYFGBq-yAwCLE5V8niLARi8eny-pM3FuzEQ18yhcX7jo/src/zmpl/debug.zig:125:32: note: types must be comptime-known

This patch uses std.heap.page_size_min which is always comptime-known (which std.heap.pageSize() conditionally returns at comptime).

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.

1 participant