21 lines
586 B
Zig
21 lines
586 B
Zig
var gAllocator: std.mem.Allocator = undefined;
|
|
|
|
pub export fn startup_module(p_allocator: *anyopaque, args: ?*anyopaque) bool {
|
|
_ = args;
|
|
|
|
gAllocator = @as(*std.mem.Allocator, @ptrCast(@alignCast(p_allocator))).*;
|
|
|
|
const allocator = gAllocator;
|
|
|
|
// do some test allocations and let it leak
|
|
const t = std.fmt.allocPrint(gAllocator, "Lmao 2 nova {d}", .{2}) catch unreachable;
|
|
std.debug.print("external module started allocated string: {s}\n", .{t});
|
|
allocator.free(t);
|
|
|
|
return true;
|
|
}
|
|
|
|
pub export fn shutdown_module() void {}
|
|
|
|
const std = @import("std");
|