32 lines
481 B
Rust
32 lines
481 B
Rust
use crate::{
|
|
mem::{gc::Gc, BasicGc},
|
|
obj::prelude::*,
|
|
};
|
|
|
|
pub type DefaultGc = BasicGc;
|
|
|
|
pub struct ObjCtx<'g, 'n, G>
|
|
where
|
|
G: Gc + 'g,
|
|
{
|
|
gc: &'g mut G,
|
|
ns: &'n mut Ns,
|
|
}
|
|
|
|
impl<'g, 'n, G> ObjCtx<'g, 'n, G>
|
|
where
|
|
G: Gc + 'g,
|
|
{
|
|
pub fn new(gc: &'g mut G, ns: &'n mut Ns) -> Self {
|
|
ObjCtx { gc, ns }
|
|
}
|
|
|
|
pub fn gc_mut(&'g mut self) -> &'g mut G {
|
|
self.gc
|
|
}
|
|
|
|
pub fn ns_mut(&'n mut self) -> &'n mut Ns {
|
|
self.ns
|
|
}
|
|
}
|