Filter out size classes that won't fit in SUPERALIGNED_CARRIER_SIZE
@@ -15,6 +15,7 @@ use liblumen_alloc_macros::generate_heap_sizes;
use liblumen_core::alloc::mmap;
use liblumen_core::alloc::size_classes::SizeClass;
+use crate::carriers;
use crate::erts::exception::system::Alloc;
use crate::erts::Term;
use crate::SizeClassAlloc;
@@ -98,6 +99,7 @@ impl ProcessHeapAlloc {
let size_classes = &Self::HEAP_SIZES[..19]
.iter()
.map(|size| SizeClass::new(*size))
+ .filter(|size_class| size_class.to_bytes() < carriers::SUPERALIGNED_CARRIER_SIZE)
.collect::<Vec<_, UHEAP_SIZES_LEN>>();
let alloc = SizeClassAlloc::new(&size_classes);
let oversized_threshold = alloc.max_size_class();
