smaller enum size

This commit is contained in:
Sander Hautvast 2023-10-11 07:43:45 +02:00
parent 93297e1f30
commit f50057705d
2 changed files with 2 additions and 2 deletions

View file

@ -25,7 +25,7 @@ pub enum ObjectRef{
BooleanArray(Vec<bool>),
CharArray(Vec<char>),
ObjectArray(Vec<Arc<UnsafeCell<ObjectRef>>>),
Object(Object),
Object(Box<Object>),
}

View file

@ -348,7 +348,7 @@ impl Vm {
{
println!("new {}", new_class);
let class = self.get_class(new_class)?;
let object = Arc::new(UnsafeCell::new(ObjectRef::Object(self.new_instance(class))));
let object = Arc::new(UnsafeCell::new(ObjectRef::Object(Box::new(self.new_instance(class)))));
self.local_stack().push(Value::Ref(Arc::clone(&object)));
self.heap.new_object(object);
}