mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
simplify/optimize decref logic
This commit is contained in:
parent
7aac6b6750
commit
4e39543054
2 changed files with 16 additions and 40 deletions
|
@ -220,18 +220,14 @@ impl<'ctx> PointerToRefcount<'ctx> {
|
|||
|
||||
let alignment = env.context.i32_type().const_int(alignment as _, false);
|
||||
|
||||
// has to be non-zero, or the deallocation is skipped
|
||||
let data_bytes = env.ptr_int().const_int(1, false);
|
||||
|
||||
call_void_bitcode_fn(
|
||||
env,
|
||||
&[
|
||||
env.builder.build_bitcast(
|
||||
parent.get_nth_param(0).unwrap(),
|
||||
env.context.i8_type().ptr_type(AddressSpace::Generic),
|
||||
env.ptr_int().ptr_type(AddressSpace::Generic),
|
||||
"foo",
|
||||
),
|
||||
data_bytes.into(),
|
||||
alignment.into(),
|
||||
],
|
||||
roc_builtins::bitcode::UTILS_DECREF,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue