mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
...
This commit is contained in:
parent
994290f1ea
commit
364839586c
@ -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
|
Loading…
x
Reference in New Issue
Block a user