-
-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop using the deprecated Data_*
API
#905
Conversation
5293fe4
to
5260f15
Compare
Please fix the clang formatting errors and I'll merge. |
I'll try, but if I may the contributing experience is awful. I have clang-format locally and it wants to makes changes different from the GitHub Action, and the GitHub action doesn't tell what it thinks it wrong. And the |
The replacement API was introduced in Ruby 1.9.2 (2010), and the old untyped data API was marked a deprecated in the documentation as of Ruby 2.3.0 (2015) Ref: https://bugs.ruby-lang.org/issues/19998
The replacement API was introduced in Ruby 1.9.2 (2010), and the old untyped data API was marked a deprecated in the documentation as of Ruby 2.3.0 (2015) Ref: https://bugs.ruby-lang.org/issues/19998
The replacement API was introduced in Ruby 1.9.2 (2010), and the old untyped data API was marked a deprecated in the documentation as of Ruby 2.3.0 (2015) Ref: https://bugs.ruby-lang.org/issues/19998
The replacement API was introduced in Ruby 1.9.2 (2010), and the old untyped data API was marked a deprecated in the documentation as of Ruby 2.3.0 (2015) Ref: https://bugs.ruby-lang.org/issues/19998
6a8816a
to
8d4c259
Compare
Ok, the linter is happy now. There seem to be a consistent error on 3.2, but I don't see how my changes could have caused that:
|
I've had mixed success with clang-formatter. The .clang-format file helps but there are variations with versions. The formatter was a solution to people submitting all sorts of coding styles and not following the one used in the rest of the code. The clang-format I've configured isn't exactly what I like but at least it is consistent. |
I don't see the error on previous versions. I wonder if there was an accidental change that caused it. If you can debug it that would be great. I just fixed a migration issue with the old JSON gem tests for 3.2 in the raise-on-empty branch. I plan to merge that tonight. Maybe when we merge with your changes CI will pass. |
Yeah, I totally understand the upside.
yeah that's weird. I'm pretty sure It was green before the clang-format changes. I'll try to have a look. |
Ok, so bisecting is pointing the finger at 86e5e79. I'll keep digging. |
Interesting, it fails in
There must be a marking missing somewhere. |
The replacement API was introduced in Ruby 1.9.2 (2010), and the old untyped data API was marked a deprecated in the documentation as of Ruby 2.3.0 (2015) Ref: https://bugs.ruby-lang.org/issues/19998
8d4c259
to
676b3d3
Compare
Alright, I'm an idiot: static const rb_data_type_t oj_stack_type = {
"Oj/stack",
{
NULL, // dmark
stack_mark, // dfree
NULL, I was passing the It should go green now. |
The remaining error is expected and has been fixed in another branch so all looks good. Thanks. |
The replacement API was introduced in Ruby 1.9.2 (2010),
and the old untyped data API was marked a deprecated in the documentation
as of Ruby 2.3.0 (2015)
Ref: https://bugs.ruby-lang.org/issues/19998
I made the minimal migration, which simply use
TypedData
, but it open the door to enable many GC features such as write barriers, immediate free, compaction support etc. But to avoid accidentally introducing any bugs I didn't do any of that, I kept changes the minimum.On a side note I noticed this:
To answer the comment, yes this is most definitely a memory leak, but it's unclear to me why the data pointer is even cleared in the first place, instead of letting the object free the memory. So since I don't understand why this is done I didn't attempt to fix it.