This commit is contained in:
blueloveTH 2023-05-20 19:07:36 +08:00
parent 994290f1ea
commit 364839586c

View File

@ -104,6 +104,7 @@ struct Dict{
_probe(key, ok, i);
if(!ok) return;
_items[i].first = nullptr;
_items[i].second = nullptr;
_size--;
}
@ -129,6 +130,14 @@ struct Dict{
}
~Dict(){ if(_items!=nullptr) pool128.dealloc(_items); }
void _gc_mark() const{
for(int i=0; i<_capacity; i++){
if(_items[i].first == nullptr) continue;
OBJ_MARK(_items[i].first);
OBJ_MARK(_items[i].second);
}
}
};
} // namespace pkpy