Sha256: 1a6d5791f2a3530b6af7c5f56656b491b8d6e07b9a11c716137f8ec71e59ff3e

Contents?: true

Size: 1.43 KB

Versions: 13

Compression:

Stored size: 1.43 KB

Contents

require "mkmf"

if RUBY_VERSION < "1.9.3"
  STDERR.puts("Ruby version #{RUBY_VERSION} is no longer supported. Please upgrade to 1.9.3 or higher")
  exit(1)
end

# standard ruby methods
have_func("rb_gc_stat")
have_func("rb_gc_count")

# Alexander Dymo GC patch
have_func("rb_os_allocated_objects")
have_func("rb_gc_allocated_size")

# Stefan Kaes GC patches
have_func("rb_gc_collections")
have_func("rb_gc_time")
# for ruby 2.1
have_func("rb_gc_total_time")
have_func("rb_gc_total_mallocs")
have_func("rb_gc_total_malloced_bytes")

# Lloyd Hilaiel's heap info patch
have_func("rb_heap_total_mem")
have_func("rb_gc_heap_info")

def add_define(name, value = nil)
  if value
    $defs.push("-D#{name}=#{value}")
  else
    $defs.push("-D#{name}")
  end
end

if !Gem.win_platform? && RUBY_PLATFORM !~ /(darwin|openbsd)/
  $LDFLAGS += " -lrt" # for clock_gettime
end
add_define("RUBY_VERSION", RUBY_VERSION.gsub('.', ''))

# for ruby 1.9, determine whether threads inherit trace flags (latest 1.9.2 and later should work correctly)
if RUBY_VERSION > "1.9"
  require 'set'
  threads = Set.new
  set_trace_func lambda { |*args| threads << Thread.current.object_id }
  Thread.new{1}.join
  set_trace_func nil
  if threads.size < 2
    # if we end up here, ruby does not automatically active tracing in spawned threads
    STDERR.puts("Ruby #{RUBY_VERSION} does not activate tracing in spawned threads. Consider upgrading.")
    exit(1)
  end
end

create_makefile("ruby_prof")

Version data entries

13 entries across 11 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/ruby-prof-0.15.1/ext/ruby_prof/extconf.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/ruby-prof-0.15.1/ext/ruby_prof/extconf.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/ruby-prof-0.15.1/ext/ruby_prof/extconf.rb
ruby-prof-0.15.8 ext/ruby_prof/extconf.rb
ruby-prof-0.15.7 ext/ruby_prof/extconf.rb
ruby-prof-0.15.6 ext/ruby_prof/extconf.rb
ruby-prof-0.15.5 ext/ruby_prof/extconf.rb
ruby-prof-0.15.4 ext/ruby_prof/extconf.rb
ruby-prof-0.15.3 ext/ruby_prof/extconf.rb
ruby-prof-0.15.2 ext/ruby_prof/extconf.rb
ruby-prof-0.15.1 ext/ruby_prof/extconf.rb
ruby-prof-0.15.0 ext/ruby_prof/extconf.rb
ruby-prof-0.14.2 ext/ruby_prof/extconf.rb