mirror of
https://github.com/ringtailsoftware/uvm32.git
synced 2026-06-06 15:03:40 +00:00
Zig allocator demo, using extram
This commit is contained in:
parent
a5018dab2f
commit
577aaadacd
9 changed files with 210 additions and 0 deletions
18
apps/zigalloc/src/main.zig
Normal file
18
apps/zigalloc/src/main.zig
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
const uvm = @import("uvm.zig");
|
||||
const console = @import("console.zig").getWriter();
|
||||
|
||||
fn submain() !void {
|
||||
try console.print("Hello world\n", .{});
|
||||
try console.flush();
|
||||
|
||||
const foo = try uvm.allocator().dupe(u8, "copy me");
|
||||
try console.print("dupe={s}\n", .{foo});
|
||||
try console.flush();
|
||||
|
||||
}
|
||||
|
||||
export fn main() void {
|
||||
_ = submain() catch {
|
||||
uvm.println("Caught err");
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue