Results for: "tally"

No documentation available
No documentation available

Looks up the latest specification for dependency and adds it to the always_install list.

No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

Returns true if this gem is installable for the current platform.

Returns true if this gem is installable for the current platform.

Returns true if this specification is installable on this platform.

No documentation available
No documentation available
No documentation available

Add the install/update options to the option parser.

Default description for the gem install and update commands.

No documentation available

Starts tracing object allocations from the ObjectSpace extension module.

For example:

require 'objspace'

class C
  include ObjectSpace

  def foo
    trace_object_allocations do
      obj = Object.new
      p "#{allocation_sourcefile(obj)}:#{allocation_sourceline(obj)}"
    end
  end
end

C.new.foo #=> "objtrace.rb:8"

This example has included the ObjectSpace module to make it easier to read, but you can also use the ::trace_object_allocations notation (recommended).

Note that this feature introduces a huge performance decrease and huge memory consumption.

Returns the class for the given object.

class A
  def foo
    ObjectSpace::trace_object_allocations do
      obj = Object.new
      p "#{ObjectSpace::allocation_class_path(obj)}"
    end
  end
end

A.new.foo #=> "Class"

See ::trace_object_allocations for more information and examples.

Returns the method identifier for the given object.

class A
  include ObjectSpace

  def foo
    trace_object_allocations do
      obj = Object.new
      p "#{allocation_class_path(obj)}##{allocation_method_id(obj)}"
    end
  end
end

A.new.foo #=> "Class#new"

See ::trace_object_allocations for more information and examples.

Return consuming memory size of all living objects in bytes.

If klass (should be Class object) is given, return the total memory size of instances of the given class.

Note that the returned size is incomplete. You need to deal with this information as only a HINT. Especially, the size of T_DATA may not be correct.

Note that this method does NOT return total malloc’ed memory size.

This method can be defined by the following Ruby code:

def memsize_of_all klass = false
  total = 0
  ObjectSpace.each_object{|e|
    total += ObjectSpace.memsize_of(e) if klass == false || e.kind_of?(klass)
  }
  total
end

This method is only expected to work with C Ruby.

Enable to measure GC time. You can get the result with GC.stat(:time). Note that GC time measurement can cause some performance overhead.

Return measure_total_time flag (default: true). Note that measurement can affect the application performance.

Search took: 4ms  ·  Total Results: 1169