feat: gc-arena (WIP, does not compile)

This commit is contained in:
2025-05-25 17:18:54 +08:00
parent b41fd38bcc
commit cc06369c5e
17 changed files with 882 additions and 585 deletions

View File

@@ -1,6 +1,8 @@
use std::mem::{MaybeUninit, replace, transmute};
use std::ops::Deref;
use gc_arena::Collect;
use crate::error::*;
macro_rules! into {
@@ -18,6 +20,14 @@ pub struct Stack<T, const CAP: usize> {
top: usize,
}
unsafe impl<T: Collect, const CAP: usize> Collect for Stack<T, CAP> {
fn trace(&self, cc: &gc_arena::Collection) {
for v in self.iter() {
v.trace(cc);
}
}
}
impl<T, const CAP: usize> Default for Stack<T, CAP> {
fn default() -> Self {
Self::new()