mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
memory_status.rb: remove unused values
* test/lib/memory_status.rb: remove initial status values, which are not used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8f5cbc589c
commit
b3f4db9227
1 changed files with 2 additions and 3 deletions
|
@ -1,10 +1,9 @@
|
||||||
# frozen_string_literal: false
|
# frozen_string_literal: false
|
||||||
module Memory
|
module Memory
|
||||||
keys = []
|
keys = []
|
||||||
vals = []
|
|
||||||
|
|
||||||
case
|
case
|
||||||
when File.exist?(procfile = "/proc/self/status") && (pat = /^Vm(\w+):\s+(\d+)/) =~ File.binread(procfile)
|
when File.exist?(procfile = "/proc/self/status") && (pat = /^Vm(\w+):\s+(\d+)/) =~ (data = File.binread(procfile))
|
||||||
PROC_FILE = procfile
|
PROC_FILE = procfile
|
||||||
VM_PAT = pat
|
VM_PAT = pat
|
||||||
def self.read_status
|
def self.read_status
|
||||||
|
@ -13,7 +12,7 @@ module Memory
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
read_status {|k, v| keys << k; vals << v}
|
data.scan(pat) {|k, v| keys << k.downcase.intern}
|
||||||
|
|
||||||
when /mswin|mingw/ =~ RUBY_PLATFORM
|
when /mswin|mingw/ =~ RUBY_PLATFORM
|
||||||
require 'fiddle/import'
|
require 'fiddle/import'
|
||||||
|
|
Loading…
Add table
Reference in a new issue