Add 'hotswap/' from commit '5487901d10f5a7ed200b2fbfe0a5b5cd730ba3a9'

git-subtree-dir: hotswap
git-subtree-mainline: 614695d55b
git-subtree-split: 5487901d10
This commit is contained in:
2025-08-04 22:14:43 -04:00
7 changed files with 505 additions and 0 deletions

25
hotswap/src/foo.zig Normal file
View File

@@ -0,0 +1,25 @@
const std = @import("std");
const core = @import("core.zig");
const Self = @This();
export const MODULE = core.module(Self);
pub fn startup(alloc: std.mem.Allocator) !*Self {
std.log.debug("!! startup {s} !!", .{@typeName(@This())});
return try alloc.create(Self);
}
pub fn unload(_: *Self, _: std.mem.Allocator) ![]u8 {
std.log.debug("!! unload {s} !!", .{@typeName(@This())});
return &.{};
}
pub fn reload(_: *Self, _: std.mem.Allocator, _: []u8) !void {
std.log.debug("!! reload {s} !!", .{@typeName(@This())});
}
pub fn shutdown(self: *Self, alloc: std.mem.Allocator) void {
std.log.debug("!! shutdown {s} !!", .{@typeName(@This())});
alloc.destroy(self);
}