saving
This commit is contained in:
parent
35562ab6d7
commit
55e7c955c1
|
|
@ -90,7 +90,7 @@ pub fn main() !void {
|
|||
\\ pub fn startEngine(vtable: *core.EngineObjectVTable, spec: *core.SpecVariantMap) bool {
|
||||
\\ const args = getArgs() catch return false;
|
||||
\\
|
||||
\\ var backingAllocator: std.mem.Allocator = std.heap.c_allocator;
|
||||
\\ var backingAllocator: std.mem.Allocator = std.heap.smp_allocator;
|
||||
\\ var gpa: std.heap.GeneralPurposeAllocator(.{
|
||||
\\ .stack_trace_frames = 20,
|
||||
\\ }) = .{};
|
||||
|
|
@ -162,7 +162,7 @@ pub fn main() !void {
|
|||
try writer.print(allocator, ".{s} = true,\n", .{mod});
|
||||
}
|
||||
|
||||
try writer.print(allocator, "}}, std.heap.c_allocator); }}\n", .{});
|
||||
try writer.print(allocator, "}}, std.heap.smp_allocator); }}\n", .{});
|
||||
|
||||
try writer.print(allocator, "const std = @import(\"std\");\n\n", .{});
|
||||
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ pub const createSpecVariant = core.createSpecVariant;
|
|||
pub export fn initAndRun(vtable: *core.EngineObjectVTable, spec: *core.SpecVariantMap) bool {
|
||||
const args = getArgs() catch return false;
|
||||
|
||||
var backingAllocator: std.mem.Allocator = std.heap.c_allocator;
|
||||
var backingAllocator: std.mem.Allocator = std.heap.smp_allocator;
|
||||
var gpa: std.heap.GeneralPurposeAllocator(.{
|
||||
.stack_trace_frames = 20,
|
||||
}) = .{};
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ const std = @import("std");
|
|||
|
||||
pub fn ParseArgs(comptime T: type) !T {
|
||||
// I think i am actually totally cool with leaking this one and leaving it around... just dont spam call this function
|
||||
var iter = try std.process.argsWithAllocator(std.heap.c_allocator);
|
||||
var iter = try std.process.argsWithAllocator(std.heap.smp_allocator);
|
||||
var args: T = .{};
|
||||
|
||||
const shortBuf: [32]u8 = undefined;
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ pub const StackCompactor = struct {
|
|||
var stackCompactor: *core.StackCompactor = undefined;
|
||||
|
||||
pub fn initStackCompactor() void {
|
||||
stackCompactor = core.StackCompactor.create(std.heap.c_allocator) catch unreachable;
|
||||
stackCompactor = core.StackCompactor.create(std.heap.smp_allocator) catch unreachable;
|
||||
}
|
||||
|
||||
pub inline fn pushCallStack() void {
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ pub const PhysicsRuntime = struct {
|
|||
|
||||
pub fn init(allocator: std.mem.Allocator) !*@This() {
|
||||
const self = try allocator.create(@This());
|
||||
try zphysics.init(std.heap.c_allocator, .{});
|
||||
try zphysics.init(std.heap.smp_allocator, .{});
|
||||
//try zphysics.init(allocator, .{});
|
||||
|
||||
self.* = .{
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ pub fn tick(self: *@This(), dt: f64) void {
|
|||
|
||||
while (offset < count) {
|
||||
var next = self.debugTextQueue.popFromUnlocked().?;
|
||||
next.duration -= fdt;
|
||||
next.duration -= @min(fdt, 0.3);
|
||||
|
||||
if (next.duration >= 0) {
|
||||
self.debugTextQueue.queue.push(next) catch {};
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ pub fn count(comptime n: anytype) [n]u0 {
|
|||
|
||||
test "Perf test sparse vs hashmap" {
|
||||
// this test does NOT care about freeing memory, just gonna let the arena hit it.
|
||||
var arena = std.heap.ArenaAllocator.init(std.heap.c_allocator);
|
||||
var arena = std.heap.ArenaAllocator.init(std.heap.smp_allocator);
|
||||
defer arena.deinit();
|
||||
const arenaAlloc = arena.allocator();
|
||||
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ pub fn destroy(self: *@This()) void {
|
|||
|
||||
pub fn main() !void {
|
||||
print("hello world... n", .{});
|
||||
const app = try create(std.heap.c_allocator);
|
||||
const app = try create(std.heap.smp_allocator);
|
||||
try app.loop();
|
||||
defer app.destroy();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ pub fn destroy(self: *@This()) void {
|
|||
pub fn main() !void {
|
||||
std.debug.print("lmao?\n", .{});
|
||||
print("hello world... n", .{});
|
||||
const app = try create(std.heap.c_allocator);
|
||||
const app = try create(std.heap.smp_allocator);
|
||||
try app.loop();
|
||||
defer app.destroy();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ pub fn main() !void {
|
|||
try stdout.print("Run `zig build test` to run the tests.\n", .{});
|
||||
|
||||
try bw.flush(); // don't forget to flush!
|
||||
var allocator = std.heap.c_allocator;
|
||||
var allocator = std.heap.smp_allocator;
|
||||
|
||||
const pngBuffer = try allocator.alloc(u8, 1000 * 1000 * 100);
|
||||
defer allocator.free(pngBuffer);
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ pub fn testThing(self: *@This()) !void {
|
|||
core.setBarrierCount(workerCount);
|
||||
|
||||
for (0..workerCount) |i| {
|
||||
const name = try std.fmt.allocPrintSentinel(std.heap.c_allocator, "MultiJob{d}", .{i}, 0);
|
||||
const name = try std.fmt.allocPrintSentinel(std.heap.smp_allocator, "MultiJob{d}", .{i}, 0);
|
||||
_ = name;
|
||||
// try core.dispatchJob(MultiJob{ .threadName = name, .threadId = @intCast(i), .threadCount = workerCount });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ pub fn start_module(args: core.ModuleLoaderArgs) !void {
|
|||
core.PatchOrCreateObject(imgui.utils.ConsoleWindow, .{});
|
||||
core.PatchOrCreateObject(@import("fpgame/fpgame.zig"), .{});
|
||||
|
||||
core.engine_log("hmm", .{});
|
||||
core.engine_log("this change definitely happened :^) ", .{});
|
||||
|
||||
_ = args;
|
||||
core.logDisplay("externGame", "accessing old object at {x} same object? {d}", .{ @intFromPtr(core.EngineObject(ExternGameObject).get()), @sizeOf(ExternGameObject) });
|
||||
|
|
|
|||
Loading…
Reference in New Issue