Skip to content

Commit 955e657

Browse files
committed
Remove DynMem
1 parent 44dbe17 commit 955e657

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

src/lib.zig

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,6 @@ pub fn new() !*TCCState {
3131
return tcc_new() orelse error.TCCNewError;
3232
}
3333

34-
const page_size = std.heap.page_size_min;
35-
36-
pub const DynMem = struct {
37-
allocator: std.mem.Allocator,
38-
mem: []align(page_size) u8,
39-
40-
pub fn alloc(allocator: std.mem.Allocator, size: usize) !DynMem {
41-
const mem = try allocator.alignedAlloc(u8, page_size, size);
42-
return .{
43-
.allocator = allocator,
44-
.mem = mem,
45-
};
46-
}
47-
48-
pub fn free(self: DynMem) void {
49-
std.posix.mprotect(self.mem, std.posix.PROT.READ | std.posix.PROT.WRITE) catch {};
50-
self.allocator.free(self.mem);
51-
}
52-
};
53-
5434
pub const TCCState = opaque {
5535
/// set CONFIG_TCCDIR at runtime
5636
pub fn set_lib_path(self: *TCCState, path: [:0]const u8) void {

0 commit comments

Comments
 (0)