|
|
@ -18,6 +18,9 @@ const std = @import("std");
|
|
18
|
18
|
|
|
19
|
19
|
pub fn main() !void {
|
|
20
|
20
|
var general_purpose_allocator = std.heap.GeneralPurposeAllocator(.{}){};
|
|
|
21
|
defer {
|
|
|
22
|
_ = general_purpose_allocator.detectLeaks();
|
|
|
23
|
}
|
|
21
|
24
|
const gpa = &general_purpose_allocator.allocator;
|
|
22
|
25
|
const args = try std.process.argsAlloc(gpa);
|
|
23
|
26
|
defer std.process.argsFree(gpa, args);
|
|
|
@ -65,6 +68,7 @@ pub fn main() !void {
|
|
65
|
68
|
var max_chars = std.math.min(@divTrunc(@intCast(usize, window_width), @intCast(usize, glyph_width)), msg.len);
|
|
66
|
69
|
|
|
67
|
70
|
var result: []const u8 = try gpa.alloc(u8, 0);
|
|
|
71
|
defer gpa.free(result);
|
|
68
|
72
|
|
|
69
|
73
|
const keyboardState = c.SDL_GetKeyboardState(null);
|
|
70
|
74
|
|
|
|
@ -218,8 +222,6 @@ pub fn main() !void {
|
|
218
|
222
|
|
|
219
|
223
|
c.SDL_Delay(16);
|
|
220
|
224
|
}
|
|
221
|
|
|
|
222
|
|
_ = general_purpose_allocator.detectLeaks();
|
|
223
|
225
|
}
|
|
224
|
226
|
|
|
225
|
227
|
fn runCommand(raw_cmd: []const u8, allocator: *std.mem.Allocator) ![]const u8 {
|