memprof2 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f7d49694ae39d219aa3825bdbdf5a5dffbae4ea
4
- data.tar.gz: cf598a824cdbf2d424062f7b0a94e790ba8beacc
3
+ metadata.gz: 872a5c02d0caafb72b915f3ca479cdf2645257e5
4
+ data.tar.gz: 8b77e75719e02f98820e72b3e87912eedf048a77
5
5
  SHA512:
6
- metadata.gz: e31eaf801bff2ec8f2d39da44554be1c65f661d3eb46d53debff04243db77945b3883be0dd7af90a2ae64a24f1e292fd86126bd329566e57f8ce546ac338150d
7
- data.tar.gz: 470ce1c09df87bc05f5635f532f1b9fadf692ae863115cdebad5c896331f8934cc4864ad013327d88d65eb6c3a70a571201726958de3b062082e25d5fd4be45f
6
+ metadata.gz: ff43e44e94c77894d74dd75adb759612201a0728332ef39a0cb4fb5469a428322e0e4c9eecfba0901e8582fd74cf609a947dc98f2f781f1211935387f9a37d8a
7
+ data.tar.gz: c48dc094f0ffec7cb362c7111b894814a0da4e4a8b33bc1bad1d9c3ad8f8b0e1e403e566f36b638ebb72f3f069c7fe624d1f2753df188fc5ae12dd5bfb69bf18
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
18
  example.out
19
+ .ruby-version
data/.travis.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.0
3
+ - 2.1
4
+ - 2.2
4
5
  script: 'bundle exec rake test'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.1.0 (2015/02/19)
2
+
3
+ Enhancements
4
+
5
+ * Use imcompatible memsize_of of ruby 2.2 which enables to get memsize correctly
6
+
1
7
  # 0.0.2 (2014/12/12)
2
8
 
3
9
  Enhancements
data/README.md CHANGED
@@ -95,6 +95,10 @@ For the block of ruby code, print out file:line:class pairs for ruby objects cre
95
95
 
96
96
  See [CHANGELOG.md](CHANGELOG.md) for details.
97
97
 
98
+ ## See Also
99
+
100
+ * [Ruby でラインメモリプロファイラ](http://qiita.com/sonots/items/c14b3e3ca8e6f7dfb651) (Japanese)
101
+
98
102
  ## Contributing
99
103
 
100
104
  1. Fork it
data/lib/memprof2.rb CHANGED
@@ -58,7 +58,15 @@ class Memprof2
58
58
  next if (@trace and @trace !~ file)
59
59
  next if (@ignore and @ignore =~ file)
60
60
  line = ObjectSpace.allocation_sourceline(o)
61
- memsize = ObjectSpace.memsize_of(o) + @rvalue_size
61
+ if RUBY_VERSION >= "2.2.0"
62
+ # Ruby 2.2.0 takes into account sizeof(RVALUE)
63
+ # https://bugs.ruby-lang.org/issues/8984
64
+ memsize = ObjectSpace.memsize_of(o)
65
+ else
66
+ # Ruby < 2.2.0 does not have ways to get memsize correctly, but let me make a bid as much as possible
67
+ # https://twitter.com/sonots/status/544334978515869698
68
+ memsize = ObjectSpace.memsize_of(o) + @rvalue_size
69
+ end
62
70
  memsize = @rvalue_size if memsize > 100_000_000_000 # compensate for API bug
63
71
  klass = o.class.name rescue "BasicObject"
64
72
  location = "#{file}:#{line}:#{klass}"
data/memprof2.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "memprof2"
3
- spec.version = "0.0.2"
3
+ spec.version = "0.1.0"
4
4
  spec.authors = ["Naotoshi Seo"]
5
5
  spec.email = ["sonots@gmail.com"]
6
6
  spec.description = %q{Ruby memory profiler for >= Ruby 2.1.0}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memprof2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-11 00:00:00.000000000 Z
11
+ date: 2015-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  version: '0'
79
79
  requirements: []
80
80
  rubyforge_project:
81
- rubygems_version: 2.2.2
81
+ rubygems_version: 2.4.5
82
82
  signing_key:
83
83
  specification_version: 4
84
84
  summary: Ruby memory profiler for >= Ruby 2.1.0