cjit update
This commit is contained in:
@@ -3,7 +3,7 @@ const std = @import("std");
|
||||
text: Section = .{ .read_only = true, .executable = true },
|
||||
data: Section = .{ .read_only = false, .executable = false },
|
||||
rodata: Section = .{ .read_only = true, .executable = false },
|
||||
bss: usize,
|
||||
bss: usize = 0,
|
||||
|
||||
pub const Section = struct {
|
||||
data: std.ArrayList(u8) = .{},
|
||||
@@ -14,12 +14,13 @@ pub const Section = struct {
|
||||
const T = @TypeOf(value);
|
||||
std.debug.assert(std.meta.hasUniqueRepresentation(T));
|
||||
const bytes = std.mem.asBytes(&value);
|
||||
const alignment = @alignOf(T);
|
||||
|
||||
try self.alignForward(alignment, allocator);
|
||||
try self.writeBytes(bytes, allocator);
|
||||
}
|
||||
|
||||
pub fn writeByte(self: *Section, byte: u8, allocator: std.mem.Allocator) !void {
|
||||
try self.data.append(allocator, byte);
|
||||
}
|
||||
|
||||
pub fn writeBytes(self: *Section, data: []const u8, allocator: std.mem.Allocator) !void {
|
||||
try self.data.appendSlice(allocator, data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user