mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
layout add allocation_alignment_bytes
This commit is contained in:
parent
63c488acd8
commit
97577c92cf
2 changed files with 71 additions and 2 deletions
|
@ -158,12 +158,14 @@ impl<'ctx> PointerToRefcount<'ctx> {
|
|||
}
|
||||
|
||||
pub fn decrement<'a, 'env>(&self, env: &Env<'a, 'ctx, 'env>, layout: &Layout<'a>) {
|
||||
let alignment = layout
|
||||
.allocation_alignment_bytes(env.ptr_bytes)
|
||||
.max(env.ptr_bytes);
|
||||
|
||||
let context = env.context;
|
||||
let block = env.builder.get_insert_block().expect("to be in a function");
|
||||
let di_location = env.builder.get_current_debug_location().unwrap();
|
||||
|
||||
let alignment = layout.alignment_bytes(env.ptr_bytes).max(env.ptr_bytes);
|
||||
|
||||
let fn_name = &format!("decrement_refcounted_ptr_{}", alignment);
|
||||
|
||||
let function = match env.module.get_function(fn_name) {
|
||||
|
@ -1142,6 +1144,10 @@ fn build_rec_union_help<'a, 'ctx, 'env>(
|
|||
|
||||
env.builder.position_at_end(should_recurse_block);
|
||||
|
||||
// to increment/decrement the cons-cell itself
|
||||
let refcount_ptr = PointerToRefcount::from_ptr_to_data(env, value_ptr);
|
||||
let call_mode = mode_to_call_mode(fn_val, mode);
|
||||
|
||||
let layout = Layout::Union(union_layout);
|
||||
|
||||
match mode {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue