commit 53c63bdb73d9fbc5a54afb4977bb975b03c4c9cc (tree) parent a31b70c4b8d0bed67463b2f54e74198baa93329f Author: Jakub Konka <kubkon@jakubkonka.com> Date: Sat, 10 Oct 2020 10:52:36 +0200 Update WASI preopens doc section to use GPA Signed-off-by: Jakub Konka <kubkon@jakubkonka.com> Diffstat:
| M | doc/langref.html.in | | | 5 | ++++- |
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/doc/langref.html.in b/doc/langref.html.in @@ -9905,7 +9905,10 @@ const std = @import("std"); const PreopenList = std.fs.wasi.PreopenList; pub fn main() !void { - var preopens = PreopenList.init(std.heap.page_allocator); + var general_purpose_allocator = std.heap.GeneralPurposeAllocator(.{}){}; + const gpa = &general_purpose_allocator.allocator; + + var preopens = PreopenList.init(gpa); defer preopens.deinit(); try preopens.populate();