aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2020-10-10 10:52:36 +0200
committerJakub Konka <kubkon@jakubkonka.com>2020-10-10 20:07:16 +0200
commit53c63bdb73d9fbc5a54afb4977bb975b03c4c9cc (patch)
treed7efaea939e0e9311ff33dfde7b28b49c2620028 /doc
parenta31b70c4b8d0bed67463b2f54e74198baa93329f (diff)
downloadzig-53c63bdb73d9fbc5a54afb4977bb975b03c4c9cc.tar.gz
zig-53c63bdb73d9fbc5a54afb4977bb975b03c4c9cc.zip
Update WASI preopens doc section to use GPA
Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/langref.html.in5
1 files changed, 4 insertions, 1 deletions
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();