From 53c63bdb73d9fbc5a54afb4977bb975b03c4c9cc Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Sat, 10 Oct 2020 10:52:36 +0200 Subject: [PATCH] Update WASI preopens doc section to use GPA Signed-off-by: Jakub Konka --- doc/langref.html.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index 021fc76289..7caae4afff 100644 --- 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();