[#107008] [Ruby master Bug#18465] Make `IO#write` atomic. — "ioquatix (Samuel Williams)" <noreply@...>
Issue #18465 has been reported by ioquatix (Samuel Williams).
16 messages
2022/01/09
[#107150] [Ruby master Feature#18494] [RFC] ENV["RUBY_GC_..."]= changes GC parameters dynamically — "ko1 (Koichi Sasada)" <noreply@...>
Issue #18494 has been updated by ko1 (Koichi Sasada).
4 messages
2022/01/17
[#107170] Re: [Ruby master Feature#18494] [RFC] ENV["RUBY_GC_..."]= changes GC parameters dynamically
— Eric Wong <normalperson@...>
2022/01/17
> https://bugs.ruby-lang.org/issues/18494
[#107302] [Ruby master Bug#18553] Memory leak on compiling method call with kwargs — "ibylich (Ilya Bylich)" <noreply@...>
Issue #18553 has been reported by ibylich (Ilya Bylich).
4 messages
2022/01/27
[#107346] [Ruby master Misc#18557] DevMeeting-2022-02-17 — "mame (Yusuke Endoh)" <noreply@...>
Issue #18557 has been reported by mame (Yusuke Endoh).
18 messages
2022/01/29
[ruby-core:107247] [Ruby master Feature#18273] Class#subclasses
From:
"byroot (Jean Boussier)" <noreply@...>
Date:
2022-01-24 08:26:41 UTC
List:
ruby-core #107247
Issue #18273 has been updated by byroot (Jean Boussier).
> In my view, this method does not play well with object lifetime, semantically.
This is perfectly fine, Ruby isn't concerned about wether a `Class` is still present in the constant table or not (or if it ever was). That's also how the old Active Support implementation based on `ObjectSpace.each_object` behaved.
That's why [`DescendantTracker` keeps a `WeakMap` of the unregistered classes to give the illusion in reload mode](https://github.com/rails/rails/blob/9062d705ad9055c0f3ec73505150e0e94fff5925/activesupport/lib/active_support/descendants_tracker.rb#L26).
> If GC kicks in between lines 3 and 4, you may get different results. In my opinion, this non-determinism is not good for an API like this one.
That too was considered and is fine.
----------------------------------------
Feature #18273: Class#subclasses
https://bugs.ruby-lang.org/issues/18273#change-96108
* Author: byroot (Jean Boussier)
* Status: Closed
* Priority: Normal
----------------------------------------
Ref: https://github.com/rails/rails/pull/43481
Something we forgot to mention in [Feature #14394], is either a parameter or another method to only get direct descendants.
Active Support has been offering `Class.subclasses` as:
```ruby
def subclasses
descendants.select { |descendant| descendant.superclass == self }
end
```
It seems a bit silly to grab all descendants and then restrict the list when `Class#descendants` had to do some recursion to get them all in the first place.
### Proposal
We could either implement `Class#subclasses` directly, or accept a parameter in `Class#descendants`, e.g. `descendants(immediate = false)`.
cc @eregon
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>