Fix compaction support#7
Conversation
When storing Ruby object that are movable in C global variable, the extension MUST declare these variables to the GC, otherwise they won't be marked nor updated when compaction occurs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7 +/- ##
=======================================
Coverage 99.83% 99.83%
=======================================
Files 7 7
Lines 1193 1193
=======================================
Hits 1191 1191
Misses 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thank you @byroot, great catch! It never surfaced in any of my tests, so it would've sat silently in my code. After reading this I went through the rest of the C globals to be sure: the Really appreciate you taking the time to read the extension. 🙏💚 |
Well, they're not pinned, but immediates (they don't actually exist in memory). But yes, they don't need to be declared.
Welcome, It got featured in Ruby Weekly, that made me curious. I need to look closer at your Eisel-Lemire port, see how it compare against the Ryu port I'm using. BTW since you mention it in your README, in |
@byroot Thanks for the correction, Jean — "immediates" ✔️ Great to hear about the iterative parser landing in json 2.20 — I went iterative for the same reason. |
|
Regarding Eisel-Lemire vs Ryū:
My json_benchmarks repo has the sample files I used — the corpus is in data_files.zip (GH LFS). |
When storing Ruby object that are movable in C global variable, the extension MUST declare these variables to the GC, otherwise they won't be marked nor updated when compaction occurs.