Research custom pointer implementation for boa gc#91
Conversation
nekevss
left a comment
There was a problem hiding this comment.
This is a pretty good write up. I'm actually super excited to see this concept in action. Can you extend it with some actual example code?
It would be worth attempting to create a new allocator that relies on a custom pointer and implement some level of heap serialization.
|
|
||
| // private | ||
|
|
||
| // TODO(perf): O(n) scan; replace with a sorted index at scale. |
There was a problem hiding this comment.
I left this as a linear O(n) scan for the prototype since pools will be small. For production, we should probably replace this with a sorted index or a direct chunk map for O(1) lookups
| } | ||
|
|
||
| // overflow guard | ||
| if slot_count as u64 > super::MAX_SLOT_IDX as u64 { |
There was a problem hiding this comment.
Added explicit guards against slot_count arithmetic overflows and corrupt live_count data here. Since we are reading raw bytes from disk, we might want to throw a fuzzer at this deserializer in a follow up PR
Related to #86