-
Notifications
You must be signed in to change notification settings - Fork 9
Update readme and drop Ruby 1.8 support #30
Update readme and drop Ruby 1.8 support #30
Conversation
c4b9e49
to
53fa6fe
Compare
require 'ref/weak_reference/weak_ref' | ||
elsif defined?(::ObjectSpace._id2ref) | ||
# If ObjectSpace can lookup objects from their object_id, then use the pure ruby implementation. | ||
require 'ref/weak_reference/pure_ruby' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we getting rid of the pure Ruby implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pure_ruby
was being used only when running it on MRI 1.8 and we're dropping 1.8 support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. Got it. I missed that in my cursory scan of the PR. Thank you!
53fa6fe
to
9f8b831
Compare
…pport-to-mri19-and-mri18 Update readme and drop Ruby 1.8 support
@@ -35,12 +35,6 @@ This library also includes tools for some common uses of weak and soft reference | |||
|
|||
Ruby does come with the `WeakRef` class in the standard library. However, there are [issues with this class](https://bugs.ruby-lang.org/issues/4168) across several different Ruby runtimes. This gem provides a common interface to weak references that works across MRI, Ruby Enterprise Edition, YARV, JRuby and Rubinius. | |||
|
|||
1. MRI and REE 1.8 - `WeakRef` extends from Delegator which is a very heavy weight class under Ruby 1.8. Creating a `WeakRef` object will allocate thousands of other objects and use up hundreds of kilobytes of memory. This makes `WeakRef` all but unusable even if you only need several hundred of them. | |||
2. YARV 1.9 - `WeakRef` is unsafe to use because the garbage collector can run in a different system thread than a thread allocating memory. This exposes a bug where a `WeakRef` may end up pointing to a completely different object than it originally referenced. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are dropping 1.9 too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pitr-ch Yes, I believe there is no reason to support Ruby 1.9 in the next releases because MRI 1.9 is officially dead: https://www.ruby-lang.org/en/news/2015/02/23/support-for-ruby-1-9-3-has-ended/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support for MRI 1.9 has ended, but I've never seen any data indicating that people aren't still using it in production. So I would hesitate to say it's actually dead. For this gem and this release I think dropping 1.9 support is OK. We aren't adding any new features or fixing bugs. The main goal of this release is to drop support for old versions of Ruby (mainly MRI 1.8 and IronRuby). MRI 1.9 users will still be able to use the 1.x release so we won't be disenfranchising any users. I would argue against dropping support for MRI 1.9 in any of our other gems, however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pitr-ch Yes, you are correct. I completely lost sight of that when I post my previous response. The original suggestion in #22 was to drop support for MRI 1.8 and Iron Ruby and I think we should stick with that. My previous comment was in error. We should retain support for MRI in 1.9 until we are ready to remove MRI 1.9 support from concurrent-ruby. Thanks for catching that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.