fix list decref

This commit is contained in:
Folkert 2021-09-10 21:53:57 +02:00
parent 5e68d31afc
commit cd9b32ba65
4 changed files with 27 additions and 22 deletions

View file

@ -1136,3 +1136,17 @@ pub fn store_list<'a, 'ctx, 'env>(
"cast_collection",
)
}
pub fn decref<'a, 'ctx, 'env>(
env: &Env<'a, 'ctx, 'env>,
wrapper_struct: StructValue<'ctx>,
alignment: u32,
) {
let (_, pointer) = load_list(
env.builder,
wrapper_struct,
env.context.i8_type().ptr_type(AddressSpace::Generic),
);
crate::llvm::refcounting::decref_pointer_check_null(env, pointer, alignment);
}