27 lines
355 B
Rust
27 lines
355 B
Rust
|
|
use crate::mem::{gc::Gc, BasicGc};
|
||
|
|
|
||
|
|
pub type DefaultGc = BasicGc;
|
||
|
|
|
||
|
|
pub struct ObjCtx<G=DefaultGc>
|
||
|
|
where
|
||
|
|
G: Gc,
|
||
|
|
{
|
||
|
|
gc: G,
|
||
|
|
}
|
||
|
|
|
||
|
|
impl<G> ObjCtx<G>
|
||
|
|
where
|
||
|
|
G: Gc,
|
||
|
|
{
|
||
|
|
pub fn new(gc: G) -> Self {
|
||
|
|
ObjCtx { gc }
|
||
|
|
}
|
||
|
|
|
||
|
|
pub fn gc(&self) -> &G {
|
||
|
|
&self.gc
|
||
|
|
}
|
||
|
|
pub fn gc_mut(&mut self) -> &mut G {
|
||
|
|
&mut self.gc
|
||
|
|
}
|
||
|
|
}
|