use std::collections::HashMap; use std::rc::Rc; use std::sync::Arc; use crate::class::{Class, Value}; #[derive(Debug)] pub struct Object { // locked: bool, // hashcode: i32, class: Arc, pub data: HashMap>, //TODO optimize } impl Object { pub fn new(class: Arc, data: HashMap>) -> Self { Self { class, data, } } } pub(crate) struct Heap { objects: Vec>, } impl Heap { pub fn new() -> Self { Self { objects: vec![] } } pub(crate) fn new_object(&mut self, object: Arc) { self.objects.push(object); } }