Skip to content

Commit

Permalink
fix LIST_RELEASE_EXCESS_CAPACITY arg count
Browse files Browse the repository at this point in the history
  • Loading branch information
bhansconnect committed Sep 29, 2023
1 parent 05f43c5 commit 42d148d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/compiler/builtins/bitcode/src/utils.zig
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ pub fn freeDataPtrC(
const masked_ptr = ptr & ~tag_mask;

const isizes: [*]isize = @as([*]isize, @ptrFromInt(masked_ptr));
const offset = @max(1, @divFloor(alignment, @sizeOf(usize)));

return freeRcPtrC(isizes - offset, alignment);
// we always store the refcount right before the data
return freeRcPtrC(isizes - 1, alignment);
}

pub fn freeRcPtrC(
Expand Down
4 changes: 2 additions & 2 deletions crates/compiler/gen_wasm/src/low_level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ impl<'a> LowLevelCall<'a> {

// Zig arguments Wasm types
// (return pointer) i32
// list: RocList i64, i32
// list: RocList i32
// alignment: u32 i32
// element_width: usize i32
// update_mode: UpdateMode i32
Expand All @@ -564,7 +564,7 @@ impl<'a> LowLevelCall<'a> {

backend.call_host_fn_after_loading_args(
bitcode::LIST_RELEASE_EXCESS_CAPACITY,
6,
5,
false,
);
}
Expand Down

0 comments on commit 42d148d

Please sign in to comment.