mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
nullable wrapped tags
This commit is contained in:
parent
98e1ee1bf7
commit
546b702740
8 changed files with 361 additions and 10 deletions
|
@ -190,6 +190,15 @@ impl ReplAppMemory for CliMemory {
|
|||
let reference: &RocStr = unsafe { std::mem::transmute(addr) };
|
||||
reference.as_str()
|
||||
}
|
||||
|
||||
fn deref_pointer_with_tag_id(&self, addr: usize) -> (u16, u64) {
|
||||
let addr_with_id = self.deref_usize(addr);
|
||||
let tag_id_mask = 0b111;
|
||||
|
||||
let tag_id = addr_with_id & tag_id_mask;
|
||||
let data_addr = addr_with_id & !tag_id_mask;
|
||||
(tag_id as _, data_addr as _)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn mono_module_to_dylib<'a>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue