bleak_house 4.0 → 4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,4 +1,6 @@
1
1
 
2
+ v4.1. Support calculating deltas in analyze utility.
3
+
2
4
  v4.0. Track spawn points live instead of sampling.
3
5
 
4
6
  v3.7.1. Fix some nil issues with corrupted dumps (cody caughlan).
data/Manifest CHANGED
@@ -12,7 +12,6 @@ LICENSE
12
12
  LICENSE_BSD
13
13
  Manifest
14
14
  README
15
- ruby/bleak_house.patch
16
15
  ruby/configure.patch
17
16
  ruby/gc.patch
18
17
  ruby/ruby-1.8.6-p114.tar.bz2
data/README CHANGED
@@ -17,7 +17,7 @@ If you use this software, please {make a donation}[http://blog.evanweaver.com/do
17
17
  * minimal impact on runtime performance
18
18
  * fast analysis step
19
19
  * tracks all objects allocated on the heap, including internal types like <tt>T_NODE</tt>
20
- * easy integration in any program, not just Rails
20
+ * easy integration into any program, not just Rails
21
21
 
22
22
  == Requirements
23
23
 
@@ -48,13 +48,13 @@ Then, to engage the logger (possibly in a live deployment situation), start a se
48
48
  Look for the message:
49
49
  ** Bleakhouse: installed
50
50
 
51
- Browse around manually, thrash your entire app with a script, target troublesome controllers/actions, etc. After a couple hundred requests, hit CTRL-C. The server will stop and BleakHouse will produce a dumpfile in <tt>/tmp</tt>:
51
+ Exercise your app. After a couple hundred requests, hit CTRL-C. The server will stop and BleakHouse will produce a dumpfile in <tt>/tmp</tt>:
52
52
 
53
53
  ** BleakHouse: working...
54
54
  ** BleakHouse: complete
55
55
  ** Bleakhouse: run 'bleak /tmp/bleak.5979.0.dump' to analyze.
56
56
 
57
- To analyse it, just run the listed command. The top 20 leakiest lines will be listed:
57
+ To analyze it, just run the listed command. The top 20 leakiest lines will be listed:
58
58
 
59
59
  191691 total objects
60
60
  Final heap size 191691 filled, 220961 free
@@ -73,8 +73,6 @@ You can pass an integer as the second parameter to <tt>bleak</tt> if you want to
73
73
 
74
74
  The underscored types are special Ruby internal structs, but can be real leaks just as easily as fullblown classes.
75
75
 
76
- Do not try to detect Rails leaks in <tt>development</tt> mode. Make a separate <tt>benchmark</tt> environment if you need to, and make sure all your production caching is turned on.
77
-
78
76
  = Extras
79
77
 
80
78
  == Injecting a signal
@@ -83,6 +81,8 @@ You can send <tt>SIGUSR2</tt> to a BleakHouse-instrumented program to snag a dum
83
81
 
84
82
  == Tips
85
83
 
84
+ Do not try to detect Rails leaks in <tt>development</tt> mode. Make a separate <tt>benchmark</tt> environment if you need to, and make sure all your production caching is turned on.
85
+
86
86
  It is normal to see lots of <tt>null:null</tt> references, especially for nodes. Using <tt>eval()</tt> too much can be a cause of node leaks. You can track <tt>eval()</tt> by using sourceline macros in your code:
87
87
 
88
88
  eval("CODE", nil, __FILE__, __LINE__)
@@ -91,7 +91,7 @@ You may get library require errors if you install <tt>ruby-bleak-house</tt> 1.8.
91
91
 
92
92
  It is not recommended that you use <tt>ruby-bleak-house</tt> as your production Ruby binary, since it will be slightly slower and use slightly more memory. It is unlikely, however, to affect stability.
93
93
 
94
- If BleakHouse doesn't report any heap growth but you still have memory growth, you might have a broken C extension, or have encounted a {real leak in the interpreter}[http://groups.google.com/group/god-rb/browse_thread/thread/1cca2b7c4]. Try using Valgrind[http://blog.evanweaver.com/articles/2008/02/05/valgrind-and-ruby/] instead.
94
+ If BleakHouse doesn't report any heap growth but you still have memory growth, you might have a broken C extension, or have encounted a {real leak in the interpreter}[http://groups.google.com/group/god-rb/browse_thread/thread/01cca2b7c4a581c2]. Try using Valgrind[http://blog.evanweaver.com/articles/2008/02/05/valgrind-and-ruby/] instead.
95
95
 
96
96
  == Methods
97
97
 
@@ -111,6 +111,7 @@ Patches and contributions are very welcome. Please note that contributors are re
111
111
 
112
112
  == Further resources
113
113
 
114
+ * http://blog.evanweaver.com/articles/2008/04/06/bleakhouse-4/
114
115
  * http://blog.evanweaver.com/articles/2008/02/05/valgrind-and-ruby/
115
116
  * http://blog.evanweaver.com/articles/2007/05/12/let-me-hit-you-with-some-knowledge
116
117
  * http://blog.evanweaver.com/articles/2007/05/06/leak-proof-direct-heap-instrumentation-for-bleak_house
data/TODO CHANGED
@@ -1,3 +1,8 @@
1
1
 
2
- * Add some kind of delta support
3
- * Log several levels of the backtrace instead of just the current node's information
2
+ * Override Kernel#eval to always include sourceline macros.
3
+ * Mimic Valgrind's output format as much as possible
4
+ * Log remaining heap reference traces
5
+ * Add some kind of start/end delta support
6
+ * Log entire backtrace by allocating pointer arrays on the heap
7
+ - Add some kind of hashing procedure to avoid duplicating identical backtrace pointer arrays
8
+ * Report individual types of nodes
data/bin/bleak CHANGED
@@ -3,11 +3,11 @@
3
3
  require 'rubygems'
4
4
 
5
5
  if !ARGV[0]
6
- puts "Please specify a BleakHouse logfile"
6
+ puts "Please specify up to two BleakHouse logfiles"
7
7
  exit
8
8
  else
9
9
  $LOAD_PATH << "#{File.dirname(__FILE__)}/../lib/"
10
10
  require 'bleak_house/analyzer'
11
11
  require 'ruby-debug' if ENV['DEBUG']
12
- BleakHouse::Analyzer.run(ARGV[0], ARGV[1] || 20)
12
+ BleakHouse::Analyzer.run(*ARGV)
13
13
  end
data/bleak_house.gemspec CHANGED
@@ -1,29 +1,29 @@
1
1
 
2
- # Gem::Specification for Bleak_house-4.0
2
+ # Gem::Specification for Bleak_house-4.1
3
3
  # Originally generated by Echoe
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = %q{bleak_house}
7
- s.version = "4.0"
7
+ s.version = "4.1"
8
8
 
9
9
  s.specification_version = 2 if s.respond_to? :specification_version=
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.authors = ["Evan Weaver"]
13
- s.date = %q{2008-04-06}
13
+ s.date = %q{2008-05-26}
14
14
  s.default_executable = %q{bleak}
15
15
  s.description = %q{A library for finding memory leaks.}
16
16
  s.email = %q{}
17
17
  s.executables = ["bleak"]
18
18
  s.extensions = ["ext/extconf.rb"]
19
19
  s.extra_rdoc_files = ["CHANGELOG", "ext/snapshot.c", "lib/bleak_house/analyzer.rb", "lib/bleak_house/hook.rb", "lib/bleak_house.rb", "LICENSE", "LICENSE_BSD", "README", "TODO"]
20
- s.files = ["bin/bleak", "CHANGELOG", "ext/build_ruby.rb", "ext/build_snapshot.rb", "ext/extconf.rb", "ext/snapshot.c", "ext/snapshot.h", "lib/bleak_house/analyzer.rb", "lib/bleak_house/hook.rb", "lib/bleak_house.rb", "LICENSE", "LICENSE_BSD", "Manifest", "README", "ruby/bleak_house.patch", "ruby/configure.patch", "ruby/gc.patch", "ruby/ruby-1.8.6-p114.tar.bz2", "ruby/valgrind.patch", "test/benchmark/bench.rb", "test/test_helper.rb", "test/unit/test_bleak_house.rb", "TODO", "bleak_house.gemspec"]
20
+ s.files = ["bin/bleak", "CHANGELOG", "ext/build_ruby.rb", "ext/build_snapshot.rb", "ext/extconf.rb", "ext/snapshot.c", "ext/snapshot.h", "lib/bleak_house/analyzer.rb", "lib/bleak_house/hook.rb", "lib/bleak_house.rb", "LICENSE", "LICENSE_BSD", "Manifest", "README", "ruby/configure.patch", "ruby/gc.patch", "ruby/ruby-1.8.6-p114.tar.bz2", "ruby/valgrind.patch", "test/benchmark/bench.rb", "test/test_helper.rb", "test/unit/test_bleak_house.rb", "TODO", "bleak_house.gemspec"]
21
21
  s.has_rdoc = true
22
22
  s.homepage = %q{http://blog.evanweaver.com/files/doc/fauna/bleak_house/}
23
23
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Bleak_house", "--main", "README"]
24
24
  s.require_paths = ["lib", "ext"]
25
25
  s.rubyforge_project = %q{fauna}
26
- s.rubygems_version = %q{1.1.0}
26
+ s.rubygems_version = %q{1.1.1}
27
27
  s.summary = %q{A library for finding memory leaks.}
28
28
  s.test_files = ["test/test_helper.rb", "test/unit/test_bleak_house.rb"]
29
29
  end
data/ext/snapshot.c CHANGED
@@ -58,14 +58,7 @@ static VALUE snapshot(VALUE self, VALUE _logfile) {
58
58
  if (obj->file) {
59
59
  chr = obj->file;
60
60
  if (*chr != '\0') {
61
- /* replace unprintable characters */
62
- for (; *chr; chr++) {
63
- if ((*chr < 33) || (*chr > 126)) {
64
- fputc('_', logfile);
65
- } else {
66
- fputc(*chr, logfile);
67
- }
68
- }
61
+ fprintf(logfile, "%s", obj->file);
69
62
  } else {
70
63
  fprintf(logfile, "__empty__");
71
64
  }
@@ -2,23 +2,52 @@
2
2
  module BleakHouse
3
3
  module Analyzer
4
4
 
5
- # Analyze a compatible <tt>bleak.dump</tt>. Accepts a filename and the number of lines to display.
6
- def self.run(file, lines)
7
- filled, free = `tail -n 2 #{file}`.split("\n")
8
- unless filled =~ /filled/ and free =~ /free/
9
- raise "#{file} is incomplete or corrupted"
10
- end
11
-
12
- length = `wc #{file}`.to_i - 2
5
+ # Analyze a compatible <tt>bleak.dump</tt>. Accepts one or more filename and the number of lines to display.
6
+ def self.run(*args)
7
+ lines = args.last[/^\d+$/] ? args.pop.to_i : 20
13
8
 
14
- puts "#{length} total objects"
15
- puts "Final heap size #{filled}, #{free}"
16
- puts "Displaying top #{lines} most common line/class pairs\n"
17
-
18
- cmd = ENV['NO_TRACE'] ? "awk -F: '{print $3}' " + file : "cat #{file}"
19
- cmd += " | sort | uniq -c | sort -nr | head -#{lines}"
9
+ raise "Can't diff more than 2 files" if args.size > 2
10
+
11
+ outputs = args.map do |file|
12
+ filled, free = `tail -n 2 #{file}`.split("\n")
13
+ unless filled =~ /filled/ and free =~ /free/
14
+ raise "#{file} is incomplete or corrupted"
15
+ end
16
+
17
+ length = `wc #{file}`.to_i - 2
18
+ cmd = ENV['NO_TRACE'] ? "awk -F: '{print $3}' " + file : "cat #{file}"
19
+ cmd += " | sort | uniq -c | sort -nr | head -#{lines}"
20
+
21
+ ["#{length} total objects", "#{filled} heap slots", "#{free} heap slots"] + `#{cmd}`.split("\n")
22
+ end
23
+
24
+ if outputs.size == 1
25
+ # Just output the data
26
+ puts "Displaying top #{lines} most common line/class pairs"
27
+ puts outputs.first
28
+ else
29
+ puts "Displaying change in top #{lines} most common line/class pairs"
30
+ puts diff(outputs)
31
+ end
20
32
 
21
- puts `#{cmd}`
33
+ end
34
+
35
+ def self.diff(outputs)
36
+ # Calculate the diff
37
+ diff = Hash.new(0)
38
+ # Iterate each item
39
+ outputs.each_with_index do |output, index|
40
+ output[3..-1].each do |line|
41
+ c, key = line.split(" ", 2)
42
+ index.zero? ? diff[key] -= c.to_i : diff[key] += c.to_i
43
+ end
44
+ end
45
+ # Format the lines in descending order
46
+ diff.sort_by do |key, value|
47
+ -value
48
+ end.map do |key, value|
49
+ "#{value.to_s.rjust(6)} #{key}"
50
+ end
22
51
  end
23
52
 
24
53
  end
data/ruby/gc.patch CHANGED
@@ -114,3 +114,16 @@ Index: gc.c
114
114
 
115
115
  if (lev > GC_LEVEL_MAX || (lev == 0 && ruby_stack_check())) {
116
116
  if (!mark_stack_overflow) {
117
+ Index: version.h
118
+ ===================================================================
119
+ --- version.h (revision 6439)
120
+ +++ version.h (working copy)
121
+ @@ -2,7 +2,7 @@
122
+ #define RUBY_RELEASE_DATE "2008-03-03"
123
+ #define RUBY_VERSION_CODE 186
124
+ #define RUBY_RELEASE_CODE 20080303
125
+ -#define RUBY_PATCHLEVEL 114
126
+ +#define RUBY_PATCHLEVEL 901
127
+
128
+ #define RUBY_VERSION_MAJOR 1
129
+ #define RUBY_VERSION_MINOR 8
data/ruby/valgrind.patch CHANGED
@@ -46,19 +46,6 @@ Index: configure.in
46
46
  AC_SUBST(XLDFLAGS)dnl
47
47
  AC_SUBST(LIBRUBY_LDSHARED)
48
48
  AC_SUBST(LIBRUBY_DLDFLAGS)
49
- Index: version.h
50
- ===================================================================
51
- --- version.h (revision 6439)
52
- +++ version.h (working copy)
53
- @@ -2,7 +2,7 @@
54
- #define RUBY_RELEASE_DATE "2008-03-03"
55
- #define RUBY_VERSION_CODE 186
56
- #define RUBY_RELEASE_CODE 20080303
57
- -#define RUBY_PATCHLEVEL 114
58
- +#define RUBY_PATCHLEVEL 901
59
-
60
- #define RUBY_VERSION_MAJOR 1
61
- #define RUBY_VERSION_MINOR 8
62
49
  Index: eval.c
63
50
  ===================================================================
64
51
  --- eval.c (revision 6439)
@@ -36,7 +36,9 @@ class BleakHouseTest < Test::Unit::TestCase
36
36
  Dir.chdir(File.dirname(__FILE__) + "/../../bin") do
37
37
  output = `./bleak #{FILE}`.split("\n")
38
38
  # require 'ruby-debug/debugger'
39
- assert_match(/\d+ __null__:__null__:__node__/, output[3])
39
+ assert_match(/top 20 most common/, output[0])
40
+ assert_match(/free heap/, output[3])
41
+ assert_match(/\d+ __null__:__null__:__node__/, output[4])
40
42
  end
41
43
  end
42
44
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bleak_house
3
3
  version: !ruby/object:Gem::Version
4
- version: "4.0"
4
+ version: "4.1"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Weaver
@@ -30,7 +30,7 @@ cert_chain:
30
30
  yZ0=
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2008-04-06 00:00:00 -04:00
33
+ date: 2008-05-26 00:00:00 -04:00
34
34
  default_executable:
35
35
  dependencies: []
36
36
 
@@ -65,7 +65,6 @@ files:
65
65
  - LICENSE_BSD
66
66
  - Manifest
67
67
  - README
68
- - ruby/bleak_house.patch
69
68
  - ruby/configure.patch
70
69
  - ruby/gc.patch
71
70
  - ruby/ruby-1.8.6-p114.tar.bz2
@@ -103,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
102
  requirements: []
104
103
 
105
104
  rubyforge_project: fauna
106
- rubygems_version: 1.1.0
105
+ rubygems_version: 1.1.1
107
106
  signing_key:
108
107
  specification_version: 2
109
108
  summary: A library for finding memory leaks.
metadata.gz.sig CHANGED
Binary file
@@ -1,358 +0,0 @@
1
- Index: parse.y
2
- ===================================================================
3
- --- parse.y (revision 6446)
4
- +++ parse.y (working copy)
5
- @@ -6168,6 +6168,11 @@
6
- * :wait2, :$>]
7
- */
8
-
9
- +struct st_table *
10
- +rb_parse_sym_tbl() {
11
- + return sym_tbl;
12
- +}
13
- +
14
- VALUE
15
- rb_sym_all_symbols()
16
- {
17
- Index: configure
18
- ===================================================================
19
- --- configure (revision 6446)
20
- +++ configure (working copy)
21
- @@ -720,6 +720,7 @@
22
- ARCHFILE
23
- RDOCTARGET
24
- XCFLAGS
25
- +VALGRIND_CFLAGS
26
- XLDFLAGS
27
- LIBRUBY_LDSHARED
28
- LIBRUBY_DLDFLAGS
29
- @@ -1356,6 +1357,7 @@
30
- --enable-pthread use pthread library.
31
- --disable-fastthread do not use the fastthread mutex
32
- --enable-setreuid use setreuid()/setregid() according to need even if obsolete.
33
- + --enable-valgrind use valgrind support
34
- --disable-rpath embed run path into extension libraries.
35
- --enable-shared build a shared library for Ruby.
36
- --enable-install-doc build and install rdoc indexes during install
37
- @@ -12988,13 +12990,11 @@
38
- cat confdefs.h >>conftest.$ac_ext
39
- cat >>conftest.$ac_ext <<_ACEOF
40
- /* end confdefs.h. */
41
- -#include <sys/types.h> /* for off_t */
42
- - #include <stdio.h>
43
- +#include <stdio.h>
44
- int
45
- main ()
46
- {
47
- -int (*fp) (FILE *, off_t, int) = fseeko;
48
- - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
49
- +return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
50
- ;
51
- return 0;
52
- }
53
- @@ -13034,13 +13034,11 @@
54
- cat >>conftest.$ac_ext <<_ACEOF
55
- /* end confdefs.h. */
56
- #define _LARGEFILE_SOURCE 1
57
- -#include <sys/types.h> /* for off_t */
58
- - #include <stdio.h>
59
- +#include <stdio.h>
60
- int
61
- main ()
62
- {
63
- -int (*fp) (FILE *, off_t, int) = fseeko;
64
- - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
65
- +return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
66
- ;
67
- return 0;
68
- }
69
- @@ -15768,6 +15766,172 @@
70
- fi
71
- fi
72
-
73
- +# Check whether --enable-valgrind was given.
74
- +if test "${enable_valgrind+set}" = set; then
75
- + enableval=$enable_valgrind; want_valgrind=$enableval
76
- +else
77
- + want_valgrind=auto
78
- +fi
79
- +
80
- +
81
- +if test x"$want_valgrind" != xno; then
82
- +
83
- +for ac_header in valgrind/memcheck.h
84
- +do
85
- +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
86
- +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
87
- + { echo "$as_me:$LINENO: checking for $ac_header" >&5
88
- +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
89
- +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
90
- + echo $ECHO_N "(cached) $ECHO_C" >&6
91
- +fi
92
- +ac_res=`eval echo '${'$as_ac_Header'}'`
93
- + { echo "$as_me:$LINENO: result: $ac_res" >&5
94
- +echo "${ECHO_T}$ac_res" >&6; }
95
- +else
96
- + # Is the header compilable?
97
- +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
98
- +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
99
- +cat >conftest.$ac_ext <<_ACEOF
100
- +/* confdefs.h. */
101
- +_ACEOF
102
- +cat confdefs.h >>conftest.$ac_ext
103
- +cat >>conftest.$ac_ext <<_ACEOF
104
- +/* end confdefs.h. */
105
- +$ac_includes_default
106
- +#include <$ac_header>
107
- +_ACEOF
108
- +rm -f conftest.$ac_objext
109
- +if { (ac_try="$ac_compile"
110
- +case "(($ac_try" in
111
- + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
112
- + *) ac_try_echo=$ac_try;;
113
- +esac
114
- +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
115
- + (eval "$ac_compile") 2>conftest.er1
116
- + ac_status=$?
117
- + grep -v '^ *+' conftest.er1 >conftest.err
118
- + rm -f conftest.er1
119
- + cat conftest.err >&5
120
- + echo "$as_me:$LINENO: \$? = $ac_status" >&5
121
- + (exit $ac_status); } && {
122
- + test -z "$ac_c_werror_flag" ||
123
- + test ! -s conftest.err
124
- + } && test -s conftest.$ac_objext; then
125
- + ac_header_compiler=yes
126
- +else
127
- + echo "$as_me: failed program was:" >&5
128
- +sed 's/^/| /' conftest.$ac_ext >&5
129
- +
130
- + ac_header_compiler=no
131
- +fi
132
- +
133
- +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
134
- +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
135
- +echo "${ECHO_T}$ac_header_compiler" >&6; }
136
- +
137
- +# Is the header present?
138
- +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
139
- +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
140
- +cat >conftest.$ac_ext <<_ACEOF
141
- +/* confdefs.h. */
142
- +_ACEOF
143
- +cat confdefs.h >>conftest.$ac_ext
144
- +cat >>conftest.$ac_ext <<_ACEOF
145
- +/* end confdefs.h. */
146
- +#include <$ac_header>
147
- +_ACEOF
148
- +if { (ac_try="$ac_cpp conftest.$ac_ext"
149
- +case "(($ac_try" in
150
- + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
151
- + *) ac_try_echo=$ac_try;;
152
- +esac
153
- +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
154
- + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
155
- + ac_status=$?
156
- + grep -v '^ *+' conftest.er1 >conftest.err
157
- + rm -f conftest.er1
158
- + cat conftest.err >&5
159
- + echo "$as_me:$LINENO: \$? = $ac_status" >&5
160
- + (exit $ac_status); } >/dev/null && {
161
- + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
162
- + test ! -s conftest.err
163
- + }; then
164
- + ac_header_preproc=yes
165
- +else
166
- + echo "$as_me: failed program was:" >&5
167
- +sed 's/^/| /' conftest.$ac_ext >&5
168
- +
169
- + ac_header_preproc=no
170
- +fi
171
- +
172
- +rm -f conftest.err conftest.$ac_ext
173
- +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
174
- +echo "${ECHO_T}$ac_header_preproc" >&6; }
175
- +
176
- +# So? What about this header?
177
- +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
178
- + yes:no: )
179
- + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
180
- +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
181
- + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
182
- +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
183
- + ac_header_preproc=yes
184
- + ;;
185
- + no:yes:* )
186
- + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
187
- +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
188
- + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
189
- +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
190
- + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
191
- +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
192
- + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
193
- +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
194
- + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
195
- +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
196
- + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
197
- +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
198
- +
199
- + ;;
200
- +esac
201
- +{ echo "$as_me:$LINENO: checking for $ac_header" >&5
202
- +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
203
- +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
204
- + echo $ECHO_N "(cached) $ECHO_C" >&6
205
- +else
206
- + eval "$as_ac_Header=\$ac_header_preproc"
207
- +fi
208
- +ac_res=`eval echo '${'$as_ac_Header'}'`
209
- + { echo "$as_me:$LINENO: result: $ac_res" >&5
210
- +echo "${ECHO_T}$ac_res" >&6; }
211
- +
212
- +fi
213
- +if test `eval echo '${'$as_ac_Header'}'` = yes; then
214
- + cat >>confdefs.h <<_ACEOF
215
- +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
216
- +_ACEOF
217
- + have_valgrind=yes
218
- +else
219
- + have_valgrind=no
220
- +fi
221
- +
222
- +done
223
- +
224
- + if test x"$have_valgrind" = xyes; then
225
- + cat >>confdefs.h <<\_ACEOF
226
- +#define HAVE_VALGRIND 1
227
- +_ACEOF
228
- +
229
- + VALGRIND_CFLAGS="";
230
- + elif test x"$want_valgrind" = xyes -a x"$have_valgrind" = xno; then
231
- + { { echo "$as_me:$LINENO: error: valgrind support requested but valgrind not found" >&5
232
- +echo "$as_me: error: valgrind support requested but valgrind not found" >&2;}
233
- + { (exit 1); exit 1; }; }
234
- + else
235
- + VALGRIND_CFLAGS="";
236
- + fi
237
- +fi
238
- +
239
- DEFAULT_KCODE="KCODE_NONE"
240
-
241
-
242
- @@ -17854,6 +18018,7 @@
243
- ARCHFILE!$ARCHFILE$ac_delim
244
- RDOCTARGET!$RDOCTARGET$ac_delim
245
- XCFLAGS!$XCFLAGS$ac_delim
246
- +VALGRIND_CFLAGS!$VALGRIND_CFLAGS$ac_delim
247
- XLDFLAGS!$XLDFLAGS$ac_delim
248
- LIBRUBY_LDSHARED!$LIBRUBY_LDSHARED$ac_delim
249
- LIBRUBY_DLDFLAGS!$LIBRUBY_DLDFLAGS$ac_delim
250
- @@ -17887,7 +18052,7 @@
251
- LTLIBOBJS!$LTLIBOBJS$ac_delim
252
- _ACEOF
253
-
254
- - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 42; then
255
- + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 43; then
256
- break
257
- elif $ac_last_try; then
258
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
259
- Index: parse.c
260
- ===================================================================
261
- --- parse.c (revision 6446)
262
- +++ parse.c (working copy)
263
- @@ -11157,6 +11157,11 @@
264
- * :wait2, :$>]
265
- */
266
-
267
- +struct st_table *
268
- +rb_parse_sym_tbl() {
269
- + return sym_tbl;
270
- +}
271
- +
272
- VALUE
273
- rb_sym_all_symbols()
274
- {
275
- Index: gc.c
276
- ===================================================================
277
- --- gc.c (revision 6446)
278
- +++ gc.c (working copy)
279
- @@ -260,8 +260,6 @@
280
- }
281
- }
282
-
283
- -#undef GC_DEBUG
284
- -
285
- void
286
- rb_global_variable(var)
287
- VALUE *var;
288
- @@ -296,10 +294,8 @@
289
- struct RVarmap varmap;
290
- struct SCOPE scope;
291
- } as;
292
- -#ifdef GC_DEBUG
293
- char *file;
294
- int line;
295
- -#endif
296
- } RVALUE;
297
-
298
- #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CYGWIN__)
299
- @@ -318,6 +314,22 @@
300
- static int heaps_length = 0;
301
- static int heaps_used = 0;
302
-
303
- +struct heaps_slot *
304
- +rb_gc_heap_slots()
305
- +{
306
- + return heaps;
307
- +}
308
- +
309
- +int
310
- +rb_gc_heaps_used() {
311
- + return heaps_used;
312
- +}
313
- +
314
- +int
315
- +rb_gc_heaps_length() {
316
- + return heaps_length;
317
- +}
318
- +
319
- #define HEAP_MIN_SLOTS 10000
320
- static int heap_slots = HEAP_MIN_SLOTS;
321
-
322
- @@ -386,16 +398,19 @@
323
- rb_newobj()
324
- {
325
- VALUE obj;
326
- -
327
- +
328
- if (!freelist) garbage_collect();
329
-
330
- obj = (VALUE)freelist;
331
- freelist = freelist->as.free.next;
332
- - MEMZERO((void*)obj, RVALUE, 1);
333
- -#ifdef GC_DEBUG
334
- - RANY(obj)->file = ruby_sourcefile;
335
- - RANY(obj)->line = ruby_sourceline;
336
- -#endif
337
- +
338
- + MEMZERO((void*)obj, RVALUE, 1);
339
- +
340
- + if (ruby_current_node && ruby_current_node->nd_file) {
341
- + RANY(obj)->file = ruby_current_node->nd_file;
342
- + RANY(obj)->line = nd_line(ruby_current_node);
343
- + }
344
- +
345
- return obj;
346
- }
347
-
348
- @@ -732,7 +747,10 @@
349
- if (rb_special_const_p(ptr)) return; /* special const not marked */
350
- if (obj->as.basic.flags == 0) return; /* free cell */
351
- if (obj->as.basic.flags & FL_MARK) return; /* already marked */
352
- +
353
- obj->as.basic.flags |= FL_MARK;
354
- + /* mark our new reference point for sourcefile objects */
355
- + mark_source_filename(RANY(obj)->file);
356
-
357
- if (lev > GC_LEVEL_MAX || (lev == 0 && ruby_stack_check())) {
358
- if (!mark_stack_overflow) {