| 1 | const std = @import("std"); |
| 2 | const Allocator = std.mem.Allocator; |
| 3 | |
| 4 | data: []const u8, |
| 5 | text: []const u8, |
| 6 | |
| 7 | const Assembly = @This(); |
| 8 | |
| 9 | pub fn deinit(self: *const Assembly, gpa: Allocator) void { |
| 10 | gpa.free(self.data); |
| 11 | gpa.free(self.text); |
| 12 | } |
| 13 | |
| 14 | pub fn writeToFile(self: Assembly, io: std.Io, file: std.Io.File) !void { |
| 15 | var file_writer = file.writer(io, &.{}); |
| 16 | |
| 17 | var buffers = [_][]const u8{ self.data, self.text }; |
| 18 | try file_writer.interface.writeSplatAll(&buffers, 1); |
| 19 | } |