mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Feature test GC.stat(:total_allocated_objects) rather than check for JRuby
This commit is contained in:
parent
81d0dc90be
commit
9636b4da36
1 changed files with 4 additions and 2 deletions
|
@ -158,13 +158,15 @@ module ActiveSupport
|
|||
end
|
||||
end
|
||||
|
||||
if defined?(JRUBY_VERSION)
|
||||
begin
|
||||
GC.stat(:total_allocated_objects)
|
||||
rescue ArgumentError # Likely on JRuby
|
||||
def now_allocations
|
||||
0
|
||||
end
|
||||
else
|
||||
def now_allocations
|
||||
GC.stat :total_allocated_objects
|
||||
GC.stat(:total_allocated_objects)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue