lib/bloat_check/stats.rb in bloat_check-0.0.2 vs lib/bloat_check/stats.rb in bloat_check-0.0.3

- old
+ new

@@ -23,10 +23,10 @@ return new(:memory => 0, :counts => {}, :time => 0) if BloatCheck.disabled? memory = `ps -o rss= -p #{$$}`.to_i counts = Hash.new(0) ObjectSpace.each_object do |obj| - klass = (class << obj ; superclass ; end) # can't use obj.class method since it may be overwritten + klass = ((class << obj ; superclass ; end) rescue Object) # don't use obj.class method since it may be overwritten counts[klass] += 1 end self.new(:memory => memory, :counts => counts, :time => Time.now) end end