Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Preparation: Merge Precise Object Tagging to Graph Copy EOP #4567

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
6be52e1
subdivide ambiguous tags
crusso May 17, 2024
7b03506
WIP: rts for precise tagging
crusso May 17, 2024
cc85f80
used correct tags in compile.ml
crusso May 17, 2024
99b2985
ugly attempt to tag allocations
crusso May 17, 2024
0b0976a
implement refined tagging; refine Blob Const (WIP); todo: refine Cons…
crusso May 18, 2024
00e5895
copy, don't alias, in blob_to_text;restrict blob_of_text; generslize …
crusso May 22, 2024
6bbfdea
refine Const.Array into Const.Array and Const.Tuple to reflect precis…
crusso May 22, 2024
4981b3a
adapt incremental array slicing; fix rts tests
crusso May 23, 2024
788f403
rust format
crusso May 23, 2024
30c91ee
adapt generational array slicing; updeate bench numbers
crusso May 24, 2024
28d98e0
fix blob comparistion in patterns
crusso May 30, 2024
4310118
refactor slicing
crusso May 30, 2024
448962f
hide encoding of array tags in helpers
crusso May 30, 2024
2cb651a
refactor array_slicing
crusso May 30, 2024
3de6cac
Merge branch 'master' into claudio/precise-heap-tags
crusso May 31, 2024
b44b133
extern array_slicing test
crusso May 31, 2024
8dbe885
add basic tag checking on unboxing of new tags
crusso May 31, 2024
ac88615
refine tags for actors and shared functions, TAG_BLOB_A and TAB_ARRAY_S
crusso May 31, 2024
6f581c6
format
crusso May 31, 2024
9f86d91
implement required coercions
crusso Jun 1, 2024
ba137c7
fix bugs; extend interpreter; rename prims; add __LINE__ to Tagged.sa…
crusso Jun 3, 2024
4d41889
Update rts/motoko-rts/src/debug.rs
crusso Jun 4, 2024
0fdbc12
document tags
crusso Jun 4, 2024
0ed4fe6
reformat; implement and use blob_of_ptr_size, blob_of_str; fix base32…
crusso Jun 5, 2024
41f8917
remove unused pattern match code from compile.ml
crusso Jun 5, 2024
1e8d0f6
use binary, not text, blob for IDL decoding check
crusso Jun 5, 2024
e8c4c19
add more assertions
crusso Jun 5, 2024
f5e97a9
assert array tag difference is even
crusso Jun 5, 2024
afde9e1
fix one broken assert (missing TAG_BLOB_A case); refactor other asserts
crusso Jun 5, 2024
34dd29d
Update rts/motoko-rts-tests/src/gc/heap.rs
crusso Jun 6, 2024
0082f1d
Update rts/motoko-rts-tests/src/gc/heap.rs
crusso Jun 7, 2024
a1f5db7
Merge branch 'claudio/precise-heap-tags' into luc/stable-heap
luc-blaeser Jun 7, 2024
b7cdc7a
Manual merge conflict resolution
luc-blaeser Jun 7, 2024
02b6b4b
Merge branch 'luc/stable-heap' into luc/stable-heap-merge-object-tagging
luc-blaeser Jun 7, 2024
b6a5f2a
Merge branch 'luc/stable-heap-merge-object-tagging' into luc/stable-h…
luc-blaeser Jun 7, 2024
f606202
Manual merge conflict resolution
luc-blaeser Jun 7, 2024
a0b0f6e
Merge branch 'luc/stable-heap64-merge-object-tagging' into luc/graph-…
luc-blaeser Jun 7, 2024
a10e14a
Manual merge conflict resolution
luc-blaeser Jun 7, 2024
8cffb0e
Fix usage of specific blob tags
luc-blaeser Jun 7, 2024
72381f9
Merge branch 'luc/stable-heap-merge-object-tagging' into luc/stable-h…
luc-blaeser Jun 7, 2024
537291f
Merge branch 'luc/stable-heap64-merge-object-tagging' into luc/graph-…
luc-blaeser Jun 7, 2024
b566edc
Adjust test case, remove file check
luc-blaeser Jun 10, 2024
54266a0
Merge branch 'luc/stable-heap' into luc/stable-heap-merge-object-tagging
luc-blaeser Jun 17, 2024
f31bfad
Merge branch 'luc/stable-heap64' into luc/stable-heap64-merge-object-…
luc-blaeser Jun 17, 2024
92767f8
Merge branch 'luc/graph-copy-on-stable-heap64' into luc/graph-copy-on…
luc-blaeser Jun 17, 2024
8524d54
Merge branch 'luc/stable-heap64' into luc/stable-heap64-merge-object-…
luc-blaeser Jun 18, 2024
b62d149
Manual merge conflict resolution
luc-blaeser Jun 18, 2024
d546419
Merge branch 'luc/graph-copy-on-stable-heap64' into luc/graph-copy-on…
luc-blaeser Jun 18, 2024
b80dbb1
Manual merge conflict resolution
luc-blaeser Jun 18, 2024
98cf87d
Merge branch 'luc/graph-copy-on-stable-heap64' into luc/graph-copy-on…
luc-blaeser Jun 18, 2024
bbb648a
Merge branch 'luc/graph-copy-on-stable-heap64' into luc/graph-copy-on…
luc-blaeser Jun 21, 2024
d56083c
Merge branch 'luc/stable-heap' into luc/stable-heap-merge-object-tagging
luc-blaeser Jun 21, 2024
32a7378
Merge branch 'luc/stable-heap64' into luc/stable-heap64-merge-object-…
luc-blaeser Jun 21, 2024
c3d04af
Merge branch 'luc/graph-copy-on-stable-heap64' into luc/graph-copy-on…
luc-blaeser Jun 21, 2024
f0f432e
Code refactoring in RTS
luc-blaeser Jun 24, 2024
e7bf60c
Code refactoring in compiler backend
luc-blaeser Jun 24, 2024
09c06e6
Merge branch 'luc/stable-heap-merge-object-tagging' into luc/stable-h…
luc-blaeser Jun 24, 2024
bb46a86
Merge branch 'luc/stable-heap64-merge-object-tagging' into luc/graph-…
luc-blaeser Jun 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rts/motoko-rts-tests/src/continuation_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use motoko_rts::continuation_table::{
continuation_count, recall_continuation, remember_continuation,
};
use motoko_rts::memory::alloc_blob;
use motoko_rts::types::{Bytes, Value};
use motoko_rts::types::{Bytes, Value, TAG_BLOB_B};

pub unsafe fn test() {
println!("Testing continuation table ...");
Expand All @@ -17,7 +17,7 @@ pub unsafe fn test() {

let mut heap = initialize_test_memory();

let pointers: [Value; N] = from_fn(|_| alloc_blob(&mut heap, Bytes(0)));
let pointers: [Value; N] = from_fn(|_| alloc_blob(&mut heap, TAG_BLOB_B, Bytes(0)));

let mut references: [usize; N] = [0; N];
for i in 0..N {
Expand Down
20 changes: 10 additions & 10 deletions rts/motoko-rts-tests/src/crc32.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::memory::{initialize_test_memory, reset_test_memory};

use motoko_rts::principal_id::{base32_of_checksummed_blob, base32_to_blob};
use motoko_rts::text::{text_compare, text_of_ptr_size};
use motoko_rts::principal_id::{base32_of_checksummed_blob, base32_to_blob, blob_of_ptr_size};
use motoko_rts::text::{blob_compare, text_compare, text_of_ptr_size};
use motoko_rts::types::Bytes;

pub unsafe fn test() {
Expand Down Expand Up @@ -41,36 +41,36 @@ pub unsafe fn test() {

let text = text_of_ptr_size(&mut heap, b"".as_ptr(), Bytes(0));
assert_eq!(
text_compare(
blob_compare(
base32_to_blob(&mut heap, text),
text_of_ptr_size(&mut heap, b"".as_ptr(), Bytes(0))
blob_of_ptr_size(&mut heap, b"".as_ptr(), Bytes(0))
),
0
);

let text = text_of_ptr_size(&mut heap, b"GEZDGNBVGY3TQOI".as_ptr(), Bytes(15));
assert_eq!(
text_compare(
blob_compare(
base32_to_blob(&mut heap, text),
text_of_ptr_size(&mut heap, b"123456789".as_ptr(), Bytes(9))
blob_of_ptr_size(&mut heap, b"123456789".as_ptr(), Bytes(9))
),
0
);

let text = text_of_ptr_size(&mut heap, b"MFRGGZDFMZTWQ2LKNNWG23TPOA".as_ptr(), Bytes(26));
assert_eq!(
text_compare(
blob_compare(
base32_to_blob(&mut heap, text),
text_of_ptr_size(&mut heap, b"abcdefghijklmnop".as_ptr(), Bytes(16))
blob_of_ptr_size(&mut heap, b"abcdefghijklmnop".as_ptr(), Bytes(16))
),
0
);

let text = text_of_ptr_size(&mut heap, b"em77e-bvlzu-aq".as_ptr(), Bytes(14));
assert_eq!(
text_compare(
blob_compare(
base32_to_blob(&mut heap, text),
text_of_ptr_size(
blob_of_ptr_size(
&mut heap,
b"\x23\x3f\xf2\x06\xab\xcd\x01".as_ptr(),
Bytes(7)
Expand Down
10 changes: 5 additions & 5 deletions rts/motoko-rts-tests/src/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ pub fn check_dynamic_heap(
if tag == TAG_MUTBOX {
// MutBoxes of static root array, will be scanned indirectly when checking the static root array.
offset += WORD_SIZE;
} else if tag == TAG_BLOB {
} else if tag == TAG_BLOB_B {
assert!(!is_forwarded);
// in-heap mark stack blobs
let length = read_word(heap, offset);
Expand All @@ -290,7 +290,7 @@ pub fn check_dynamic_heap(
} else if mode == CheckMode::Stabilzation && tag == TAG_MUTBOX {
offset += WORD_SIZE;
} else {
assert!(tag == TAG_ARRAY || tag >= TAG_ARRAY_SLICE_MIN);
assert!(is_array_or_slice_tag(tag));

if is_forwarded {
let forward_offset = forward - heap.as_ptr() as usize;
Expand Down Expand Up @@ -442,7 +442,7 @@ fn compute_reachable_objects(

fn check_static_root_array(mut offset: usize, roots: &[ObjectIdx], heap: &[u8]) {
let array_address = heap.as_ptr() as usize + offset;
assert_eq!(read_word(heap, offset), TAG_ARRAY);
assert_eq!(read_word(heap, offset), TAG_ARRAY_M);
offset += WORD_SIZE;

assert_eq!(read_word(heap, offset), make_pointer(array_address));
Expand Down Expand Up @@ -476,7 +476,7 @@ fn read_mutbox_field(mutbox_address: usize, heap: &[u8]) -> usize {

fn check_continuation_table(mut offset: usize, continuation_table: &[ObjectIdx], heap: &[u8]) {
let table_addr = heap.as_ptr() as usize + offset;
assert_eq!(read_word(heap, offset), TAG_ARRAY);
assert_eq!(read_word(heap, offset), TAG_ARRAY_M);
offset += WORD_SIZE;

assert_eq!(read_word(heap, offset), make_pointer(table_addr));
Expand All @@ -496,7 +496,7 @@ fn check_continuation_table(mut offset: usize, continuation_table: &[ObjectIdx],

fn read_object_id(object_address: usize, heap: &[u8]) -> ObjectIdx {
let tag = read_word(heap, object_address - heap.as_ptr() as usize);
assert!(tag == TAG_ARRAY || tag >= TAG_ARRAY_SLICE_MIN);
assert!(is_array_or_slice_tag(tag));

// Skip object header for idx
let idx_address = object_address + size_of::<Array>().to_bytes().as_usize();
Expand Down
6 changes: 3 additions & 3 deletions rts/motoko-rts-tests/src/gc/heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ fn create_dynamic_heap(

// Store object header
let address = heap_start + heap_offset;
write_word(dynamic_heap, heap_offset, TAG_ARRAY);
write_word(dynamic_heap, heap_offset, TAG_ARRAY_M);
heap_offset += WORD_SIZE;

write_word(dynamic_heap, heap_offset, make_pointer(address)); // forwarding pointer
Expand Down Expand Up @@ -413,7 +413,7 @@ fn create_dynamic_heap(
}
let static_root_array_address = heap_start + heap_offset;
{
write_word(dynamic_heap, heap_offset, TAG_ARRAY);
write_word(dynamic_heap, heap_offset, TAG_ARRAY_M);
heap_offset += WORD_SIZE;

write_word(
Expand All @@ -435,7 +435,7 @@ fn create_dynamic_heap(

let continuation_table_address = heap_start + heap_offset;
{
write_word(dynamic_heap, heap_offset, TAG_ARRAY);
write_word(dynamic_heap, heap_offset, TAG_ARRAY_M);
heap_offset += WORD_SIZE;

write_word(
Expand Down
30 changes: 17 additions & 13 deletions rts/motoko-rts-tests/src/gc/incremental/array_slicing.rs
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
use motoko_rts::{
gc::incremental::array_slicing::slice_array,
memory::alloc_array,
types::{Words, TAG_ARRAY, TAG_ARRAY_SLICE_MIN},
types::{Tag, Words, TAG_ARRAY_I, TAG_ARRAY_M, TAG_ARRAY_S, TAG_ARRAY_SLICE_MIN, TAG_ARRAY_T},
};

use crate::memory::TestMemory;

pub unsafe fn test() {
println!(" Testing array slicing...");

let mut mem = TestMemory::new(Words(1024 * 1024));
// multiple of slice increment
test_array_slicing(&mut mem, 4096);
// odd remainder of slice increment
test_array_slicing(&mut mem, 3999);
// small array
test_array_slicing(&mut mem, 10);
// empty array
test_array_slicing(&mut mem, 0);
let tags = vec![TAG_ARRAY_I, TAG_ARRAY_M, TAG_ARRAY_T, TAG_ARRAY_S];

for tag in tags.into_iter() {
let mut mem = TestMemory::new(Words(1024 * 1024));
// multiple of slice increment
test_array_slicing(&mut mem, tag, 4096);
// odd remainder of slice increment
test_array_slicing(&mut mem, tag, 3999);
// small array
test_array_slicing(&mut mem, tag, 10);
// empty array
test_array_slicing(&mut mem, tag, 0);
}
}

unsafe fn test_array_slicing(mem: &mut TestMemory, array_length: usize) {
let array = alloc_array(mem, array_length).as_array();
unsafe fn test_array_slicing(mem: &mut TestMemory, tag: Tag, array_length: usize) {
let array = alloc_array(mem, tag, array_length).as_array();
let mut last_offset = 0;
loop {
let new_offset = slice_array(array);
assert!(new_offset > last_offset || array.len() == 0 && new_offset == 0);
last_offset = new_offset;
if (*array).header.tag == TAG_ARRAY {
if (*array).header.tag == tag {
break;
}
assert!((*array).header.tag >= TAG_ARRAY_SLICE_MIN);
Expand Down
19 changes: 13 additions & 6 deletions rts/motoko-rts-tests/src/gc/incremental/partitioned_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ use motoko_rts::{
IncrementalGC,
},
memory::{alloc_array, alloc_blob, Memory},
types::{Array, Blob, Bytes, Obj, Tag, Value, Words, TAG_ARRAY, TAG_BLOB},
types::{
Array, Blob, Bytes, Obj, Tag, Value, Words, TAG_ARRAY_I, TAG_ARRAY_M, TAG_ARRAY_S,
TAG_ARRAY_T, TAG_BLOB_A, TAG_BLOB_B, TAG_BLOB_P, TAG_BLOB_T,
},
};

use crate::{gc::utils::WORD_SIZE, memory::TestMemory};
Expand Down Expand Up @@ -322,7 +325,7 @@ unsafe fn iterate_large_partition(
let mut time = BoundedTime::new(0);
while iterator.has_object() {
let object = iterator.current_object();
assert_eq!(object.tag(), TAG_BLOB);
assert_eq!(object.tag(), TAG_BLOB_B);
let size = block_size(object as *const Tag);
detected_sizes.push(size);
time.tick();
Expand Down Expand Up @@ -413,7 +416,7 @@ impl PartitionedTestHeap {

pub fn allocate_array(&mut self, elements: &[Value]) -> Value {
unsafe {
let array = alloc_array(self, elements.len());
let array = alloc_array(self, TAG_ARRAY_M, elements.len());
for index in 0..elements.len() {
let raw_array = array.as_array();
raw_array.set(index, elements[index], self);
Expand All @@ -423,14 +426,18 @@ impl PartitionedTestHeap {
}

pub fn allocate_blob(&mut self, size: usize) -> Value {
unsafe { alloc_blob(self, Bytes(size)) }
unsafe { alloc_blob(self, TAG_BLOB_B, Bytes(size)) }
}
}

unsafe fn block_size(block: *const Tag) -> usize {
match *block {
TAG_ARRAY => size_of::<Array>() + (block as *const Array).len() * WORD_SIZE,
TAG_BLOB => size_of::<Blob>() + (block as *const Blob).len().as_usize(),
TAG_ARRAY_I | TAG_ARRAY_M | TAG_ARRAY_T | TAG_ARRAY_S => {
size_of::<Array>() + (block as *const Array).len() * WORD_SIZE
}
TAG_BLOB_B | TAG_BLOB_T | TAG_BLOB_P | TAG_BLOB_A => {
size_of::<Blob>() + (block as *const Blob).len().as_usize()
}
_ => unimplemented!(),
}
}
Expand Down
12 changes: 7 additions & 5 deletions rts/motoko-rts-tests/src/principal_id.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use crate::memory::{initialize_test_memory, reset_test_memory};

use motoko_rts::principal_id::{blob_of_principal, principal_of_blob};
use motoko_rts::text::{text_compare, text_of_ptr_size, text_of_str};
use motoko_rts::principal_id::{
blob_of_principal, blob_of_ptr_size, blob_of_str, principal_of_blob,
};
use motoko_rts::text::{blob_compare, text_compare, text_of_ptr_size, text_of_str};
use motoko_rts::types::Bytes;

pub unsafe fn test() {
Expand Down Expand Up @@ -36,13 +38,13 @@ pub unsafe fn test() {

let text = text_of_str(&mut heap, "aaaaa-aa");
let principal = blob_of_principal(&mut heap, text);
assert_eq!(text_compare(principal, text_of_str(&mut heap, ""),), 0);
assert_eq!(blob_compare(principal, blob_of_str(&mut heap, ""),), 0);

let text = text_of_str(&mut heap, "bfozs-kwa73-7nadi");
assert_eq!(
text_compare(
blob_compare(
blob_of_principal(&mut heap, text),
text_of_ptr_size(&mut heap, b"\xC0\xFE\xFE\xD0\x0D".as_ptr(), Bytes(5))
blob_of_ptr_size(&mut heap, b"\xC0\xFE\xFE\xD0\x0D".as_ptr(), Bytes(5))
),
0
);
Expand Down
4 changes: 2 additions & 2 deletions rts/motoko-rts-tests/src/stabilization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use motoko_rts::{
stabilization::{
deserialization::Deserialization, graph_copy::GraphCopy, serialization::Serialization,
},
types::{Value, Words},
types::{Value, Words, TAG_ARRAY_M},
};
use oorandom::Rand32;

Expand Down Expand Up @@ -91,7 +91,7 @@ impl RandomHeap {
fn clear_continuation_table(&mut self) {
let table_pointer = self.memory.continuation_table_variable_address() as *mut Value;
unsafe {
*table_pointer = alloc_array(&mut self.memory, 0);
*table_pointer = alloc_array(&mut self.memory, TAG_ARRAY_M, 0);
}
}

Expand Down
14 changes: 11 additions & 3 deletions rts/motoko-rts-tests/src/stabilization/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ pub unsafe fn test() {

fn test_stable_tags() {
for object_kind in [
StableObjectKind::Array,
StableObjectKind::ArrayImmutable,
crusso marked this conversation as resolved.
Show resolved Hide resolved
StableObjectKind::ArrayMutable,
StableObjectKind::ArrayTuple,
StableObjectKind::ArraySharedFunction,
StableObjectKind::MutBox,
StableObjectKind::Object,
StableObjectKind::Blob,
StableObjectKind::Bits64,
StableObjectKind::BlobBytes,
StableObjectKind::BlobText,
StableObjectKind::BlobPrincipal,
StableObjectKind::BlobActor,
StableObjectKind::Bits64Unsigned,
StableObjectKind::Bits64Signed,
StableObjectKind::Bits64Float,
StableObjectKind::Region,
StableObjectKind::Variant,
StableObjectKind::Concat,
Expand Down
4 changes: 2 additions & 2 deletions rts/motoko-rts-tests/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use motoko_rts::text::{
text_singleton, text_size,
};
use motoko_rts::text_iter::{text_iter, text_iter_done, text_iter_next};
use motoko_rts::types::{Bytes, Value, TAG_BLOB};
use motoko_rts::types::{Bytes, Value, TAG_BLOB_T};

use std::convert::TryFrom;

Expand Down Expand Up @@ -66,7 +66,7 @@ pub unsafe fn test() {
for i in 0..8 {
let str = &STR[0..i + 1];
let text = text_of_str(&mut mem, str);
assert_eq!(text.tag(), TAG_BLOB);
assert_eq!(text.tag(), TAG_BLOB_T);
let iter = TextIter::from_text(&mut mem, text);
assert_eq!(iter.collect::<String>(), str);
}
Expand Down
5 changes: 3 additions & 2 deletions rts/motoko-rts/src/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use alloc::alloc::{GlobalAlloc, Layout};
//use core::ptr::null_mut;
use crate::memory::{alloc_blob, ic};
use crate::types::Bytes;
use crate::types::{Bytes, TAG_BLOB_B};

pub struct EphemeralAllocator;

Expand All @@ -23,7 +23,8 @@ unsafe impl GlobalAlloc for EphemeralAllocator {
let word_size = crate::constants::WORD_SIZE;
let min_align = (align + word_size - 1) / word_size * word_size;
let blob_size = size + min_align - word_size;
let blob = alloc_blob::<ic::IcMemory>(&mut ic::IcMemory, Bytes(blob_size)).as_blob_mut();
let blob = alloc_blob::<ic::IcMemory>(&mut ic::IcMemory, TAG_BLOB_B, Bytes(blob_size))
.as_blob_mut();
let payload_address = blob.payload_addr() as usize;
let aligned_address = (payload_address + min_align - 1) / min_align * min_align;

Expand Down
4 changes: 2 additions & 2 deletions rts/motoko-rts/src/blob_iter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
barriers::allocation_barrier,
memory::Memory,
types::{size_of, Array, Bytes, Value, Words, TAG_ARRAY},
types::{size_of, Array, Bytes, Value, Words, TAG_ARRAY_T},
};

use motoko_rts_macros::ic_mem_fn;
Expand All @@ -17,7 +17,7 @@ unsafe fn blob_iter<M: crate::memory::Memory>(mem: &mut M, blob: Value) -> Value

// NB. cannot use as_array() here as we didn't write the header yet
let iter_array = iter_ptr.get_ptr() as *mut Array;
(*iter_array).header.tag = TAG_ARRAY;
(*iter_array).header.tag = TAG_ARRAY_T;
(*iter_array).header.init_forward(iter_ptr);
(*iter_array).len = 2;

Expand Down
6 changes: 3 additions & 3 deletions rts/motoko-rts/src/continuation_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
use crate::barriers::{allocation_barrier, write_with_barrier};
use crate::memory::{alloc_array, Memory};
use crate::rts_trap_with;
use crate::types::Value;
use crate::types::{Value, TAG_ARRAY_M};

use motoko_rts_macros::ic_mem_fn;

Expand All @@ -50,7 +50,7 @@ static mut N_CONTINUATIONS: usize = 0;
static mut FREE_SLOT: usize = 0;

unsafe fn create_continuation_table<M: Memory>(mem: &mut M) {
TABLE = alloc_array(mem, INITIAL_SIZE);
TABLE = alloc_array(mem, TAG_ARRAY_M, INITIAL_SIZE);
FREE_SLOT = 0;
N_CONTINUATIONS = 0;

Expand All @@ -69,7 +69,7 @@ unsafe fn double_continuation_table<M: Memory>(mem: &mut M) {

let new_size = old_size * 2;

let new_table = alloc_array(mem, new_size);
let new_table = alloc_array(mem, TAG_ARRAY_M, new_size);
let new_array = new_table.as_array();

for i in 0..old_size {
Expand Down
Loading