mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
nullable wrapped tags
This commit is contained in:
parent
98e1ee1bf7
commit
546b702740
8 changed files with 361 additions and 10 deletions
|
@ -82,6 +82,15 @@ impl<'a> ReplAppMemory for WasmMemory<'a> {
|
|||
|
||||
unsafe { std::str::from_utf8_unchecked(str_bytes) }
|
||||
}
|
||||
|
||||
fn deref_pointer_with_tag_id(&self, addr: usize) -> (u16, u64) {
|
||||
let addr_with_id = self.deref_usize(addr);
|
||||
let tag_id_mask = 0b11;
|
||||
|
||||
let tag_id = addr_with_id & tag_id_mask;
|
||||
let data_addr = addr_with_id & !tag_id_mask;
|
||||
(tag_id as _, data_addr as _)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> WasmReplApp<'a> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue