nullable wrapped tags

This commit is contained in:
Folkert 2022-08-06 14:40:00 +02:00
parent 98e1ee1bf7
commit 546b702740
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
8 changed files with 361 additions and 10 deletions

View file

@ -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>(