Update WASI preopens doc section to use GPA

Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
This commit is contained in:
Jakub Konka 2020-10-10 10:52:36 +02:00
parent a31b70c4b8
commit 53c63bdb73

View file

@ -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();