use crate::{
mem::{gc::Gc, ptr::DynRef, BasicGc},
obj::Sym,
};
use std::collections::BTreeMap;
pub type DefaultGc = BasicGc;
pub struct ObjCtx<G = DefaultGc>
where
G: Gc,
{
gc: G,
globals: BTreeMap<Sym, DynRef>,
}
impl<G> ObjCtx<G>
pub fn new(gc: G) -> Self {
ObjCtx { gc, globals: Default::default() }
pub fn gc(&self) -> &G {
&self.gc
pub fn gc_mut(&mut self) -> &mut G {
&mut self.gc
pub fn globals(&self) -> &BTreeMap<Sym, DynRef> {
&self.globals
pub fn globals_mut(&mut self) -> &mut BTreeMap<Sym, DynRef> {
&mut self.globals