mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-02 03:12:20 +00:00
use zig's decref instead of an LLVM implementation
This commit is contained in:
parent
59c63ef3a8
commit
5cb7dbd3cc
5 changed files with 34 additions and 104 deletions
|
@ -104,6 +104,18 @@ pub const IntWidth = enum(u8) {
|
|||
Usize,
|
||||
};
|
||||
|
||||
pub fn decrefC(
|
||||
bytes_or_null: ?[*]u8,
|
||||
data_bytes: usize,
|
||||
alignment: u32,
|
||||
) callconv(.C) void {
|
||||
// IMPORTANT: bytes_or_null is this case is expected to be a pointer to the refcount
|
||||
// (NOT the start of the data, or the start of the allocation)
|
||||
if (bytes_or_null) |bytes| {
|
||||
return @call(.{ .modifier = always_inline }, decref, .{ bytes + @sizeOf(usize), data_bytes, alignment });
|
||||
}
|
||||
}
|
||||
|
||||
pub fn decref(
|
||||
bytes_or_null: ?[*]u8,
|
||||
data_bytes: usize,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue