Open mmmries opened 10 years ago
We don't support DATAPTR. Instead, the rb* API needs to be used. See also https://github.com/MagLev/maglev/blob/master/docs/Maglev_c_extensions.md
That being said, maybe there's a better way to implement this in MagLev, using the atomic support in GenStone.
Sorry for not doing anything on this. I just took a look at the atomic gem's code, and it looks like it should be straightforward to modify.
The first three lines that assign to DATA_PTR(self)
need to be replaced with rb_rdata_store(self, (void*)value)
. The last line should work when you replace &DATA_PTR(self)
with &rb_rdata_fetch(self)
.
If you have time to try this and it works, the updated code should work just as well on the other implementations, so a PR to the atomic gem would be perfect. You can alternatively publish the atomic gem under the name atomic-maglev-
(we have code in our Rubygems that looks for such "override packages" and installs them instead of the vanilla versions)
On the latest head (3d9829defb00ffcd750aecae8e38454da377d785) the atomic gem fails to build with the error below. A lot of gems depend on on atomic including Virtus which is what I was trying to install.