mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
free or reuse unconditionally when value is unique
This commit is contained in:
parent
e3ab023f62
commit
fc3004da58
21 changed files with 381 additions and 69 deletions
|
@ -1979,6 +1979,19 @@ impl<'a> LowLevelCall<'a> {
|
|||
);
|
||||
}
|
||||
PtrLoad => backend.expr_unbox(self.ret_symbol, self.arguments[0]),
|
||||
PtrClearTagId => {
|
||||
let ptr = self.arguments[0];
|
||||
|
||||
let ptr_local_id = match backend.storage.get(&ptr) {
|
||||
StoredValue::Local { local_id, .. } => *local_id,
|
||||
_ => internal_error!("A pointer will always be an i32"),
|
||||
};
|
||||
|
||||
backend.code_builder.get_local(ptr_local_id);
|
||||
|
||||
backend.code_builder.i32_const(-4); // 11111111...1100
|
||||
backend.code_builder.i32_and();
|
||||
}
|
||||
Alloca => {
|
||||
// Alloca : a -> Ptr a
|
||||
let arg = self.arguments[0];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue