bleak_house 3.7.1 → 4.0

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.
Files changed (87) hide show
  1. data.tar.gz.sig +0 -0
  2. data/CHANGELOG +2 -0
  3. data/Manifest +12 -66
  4. data/README +57 -20
  5. data/TODO +2 -2
  6. data/bin/bleak +1 -14
  7. data/bleak_house.gemspec +10 -16
  8. data/ext/{bleak_house/logger/build_ruby.rb → build_ruby.rb} +17 -7
  9. data/ext/build_snapshot.rb +4 -0
  10. data/ext/{bleak_house/logger/extconf.rb → extconf.rb} +1 -1
  11. data/ext/snapshot.c +157 -0
  12. data/ext/{bleak_house/logger/snapshot.h → snapshot.h} +2 -45
  13. data/lib/bleak_house.rb +5 -5
  14. data/lib/bleak_house/analyzer.rb +24 -2
  15. data/lib/bleak_house/hook.rb +25 -0
  16. data/ruby/bleak_house.patch +358 -0
  17. data/ruby/configure.patch +242 -0
  18. data/ruby/gc.patch +116 -0
  19. data/ruby/ruby-1.8.6-p114.tar.bz2 +0 -0
  20. data/ruby/valgrind.patch +136 -0
  21. data/test/benchmark/bench.rb +16 -0
  22. data/test/unit/test_bleak_house.rb +26 -27
  23. metadata +22 -86
  24. metadata.gz.sig +0 -0
  25. data/ext/bleak_house/logger/build_logger.rb +0 -3
  26. data/ext/bleak_house/logger/snapshot.c +0 -204
  27. data/init.rb +0 -3
  28. data/install.rb +0 -2
  29. data/lib/bleak_house/analyzer/analyzer.rb +0 -358
  30. data/lib/bleak_house/logger.rb +0 -2
  31. data/lib/bleak_house/logger/source.rb +0 -21
  32. data/lib/bleak_house/rails.rb +0 -6
  33. data/lib/bleak_house/rails/action_controller.rb +0 -17
  34. data/lib/bleak_house/rails/bleak_house.rb +0 -62
  35. data/lib/bleak_house/rails/dispatcher.rb +0 -36
  36. data/lib/bleak_house/support/core_extensions.rb +0 -61
  37. data/ruby/gc.c.patch +0 -27
  38. data/ruby/parse.y.patch +0 -16
  39. data/ruby/ruby-1.8.6-p110.tar.bz2 +0 -0
  40. data/test/integration/app/README +0 -203
  41. data/test/integration/app/Rakefile +0 -10
  42. data/test/integration/app/app/controllers/application.rb +0 -12
  43. data/test/integration/app/app/controllers/items_controller.rb +0 -6
  44. data/test/integration/app/app/helpers/application_helper.rb +0 -3
  45. data/test/integration/app/app/helpers/items_helper.rb +0 -2
  46. data/test/integration/app/app/views/items/index.rhtml +0 -2
  47. data/test/integration/app/config/boot.rb +0 -109
  48. data/test/integration/app/config/database.yml +0 -19
  49. data/test/integration/app/config/environment.rb +0 -15
  50. data/test/integration/app/config/environments/development.rb +0 -18
  51. data/test/integration/app/config/environments/production.rb +0 -19
  52. data/test/integration/app/config/environments/test.rb +0 -22
  53. data/test/integration/app/config/initializers/inflections.rb +0 -10
  54. data/test/integration/app/config/initializers/mime_types.rb +0 -5
  55. data/test/integration/app/config/routes.rb +0 -35
  56. data/test/integration/app/doc/README_FOR_APP +0 -2
  57. data/test/integration/app/public/404.html +0 -30
  58. data/test/integration/app/public/422.html +0 -30
  59. data/test/integration/app/public/500.html +0 -30
  60. data/test/integration/app/public/dispatch.cgi +0 -10
  61. data/test/integration/app/public/dispatch.fcgi +0 -24
  62. data/test/integration/app/public/dispatch.rb +0 -10
  63. data/test/integration/app/public/favicon.ico +0 -0
  64. data/test/integration/app/public/images/rails.png +0 -0
  65. data/test/integration/app/public/javascripts/application.js +0 -2
  66. data/test/integration/app/public/javascripts/controls.js +0 -963
  67. data/test/integration/app/public/javascripts/dragdrop.js +0 -972
  68. data/test/integration/app/public/javascripts/effects.js +0 -1120
  69. data/test/integration/app/public/javascripts/prototype.js +0 -4225
  70. data/test/integration/app/public/robots.txt +0 -5
  71. data/test/integration/app/script/about +0 -3
  72. data/test/integration/app/script/console +0 -3
  73. data/test/integration/app/script/destroy +0 -3
  74. data/test/integration/app/script/generate +0 -3
  75. data/test/integration/app/script/performance/benchmarker +0 -3
  76. data/test/integration/app/script/performance/profiler +0 -3
  77. data/test/integration/app/script/performance/request +0 -3
  78. data/test/integration/app/script/plugin +0 -3
  79. data/test/integration/app/script/process/inspector +0 -3
  80. data/test/integration/app/script/process/reaper +0 -3
  81. data/test/integration/app/script/process/spawner +0 -3
  82. data/test/integration/app/script/runner +0 -3
  83. data/test/integration/app/script/server +0 -3
  84. data/test/integration/app/test/functional/items_controller_test.rb +0 -8
  85. data/test/integration/app/test/test_helper.rb +0 -38
  86. data/test/integration/server_test.rb +0 -93
  87. data/test/misc/direct.rb +0 -13
@@ -7,51 +7,6 @@
7
7
  #include "intern.h"
8
8
  #include "string.h"
9
9
 
10
- /* Histogram of most common Rails classes */
11
- static char * builtins[] = {
12
- "String",
13
- "Array",
14
- "Hash",
15
- "Class",
16
- "Regexp",
17
- "Proc",
18
- "ActionController::Routing::DividerSegment",
19
- "Gem::Version",
20
- "Gem::Version::Requirement",
21
- "Bignum",
22
- "Symbol",
23
- "Time",
24
- "MatchData",
25
- "Gem::Specification",
26
- "ActionController::Routing::StaticSegment",
27
- "Gem::Dependency",
28
- "Module",
29
- "ActionController::Routing::DynamicSegment",
30
- "Range",
31
- "ActionController::Routing::Route",
32
- "Float",
33
- "HashWithIndifferentAccess",
34
- "Method",
35
- "Enumerable",
36
- "Comparable",
37
- "Set",
38
- "File",
39
- "Object",
40
- "NameError",
41
- "Thread",
42
- "_node",
43
- "_none",
44
- "_blktag",
45
- "_undef",
46
- "_varmap",
47
- "_scope",
48
- "_unknown"
49
- };
50
-
51
- #define BUILTINS_SIZE 30
52
- #define SPECIALS_SIZE 7
53
- #define MAX_SAMPLE_LENGTH 100
54
-
55
10
  typedef struct RVALUE {
56
11
  union {
57
12
  struct {
@@ -75,6 +30,8 @@ typedef struct RVALUE {
75
30
  struct RVarmap varmap;
76
31
  struct SCOPE scope;
77
32
  } as;
33
+ char *file;
34
+ int line;
78
35
  } RVALUE;
79
36
 
80
37
  struct heaps_slot {
@@ -1,7 +1,7 @@
1
1
 
2
- require 'bleak_house/logger'
3
-
4
- if ENV['RAILS_ENV'] and ENV['BLEAK_HOUSE']
5
- require 'bleak_house/rails'
6
- BleakHouse::Rails.warn "enabled (log/bleak_house_#{RAILS_ENV}.dump)"
2
+ unless RUBY_PATCHLEVEL > 900
3
+ raise "This build of Ruby has not been successfully patched for BleakHouse."
7
4
  end
5
+
6
+ require 'snapshot'
7
+ require 'bleak_house/hook'
@@ -1,3 +1,25 @@
1
1
 
2
- require 'bleak_house/support/core_extensions'
3
- require 'bleak_house/analyzer/analyzer'
2
+ module BleakHouse
3
+ module Analyzer
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
13
+
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}"
20
+
21
+ puts `#{cmd}`
22
+ end
23
+
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+
2
+ module BleakHouse
3
+ # The body of the exit handler and <tt>SIGUSR2</tt> trap. It writes a snapshot to a dumpfile named after the current Process.pid.
4
+ def self.hook
5
+ @count ||= 0
6
+ filename = "/tmp/bleak.#{Process.pid}.#{@count}.dump"
7
+ STDERR.puts "** BleakHouse: working..."
8
+ BleakHouse.snapshot(filename)
9
+ STDERR.puts "** BleakHouse: complete\n** Bleakhouse: Run 'bleak #{filename}' to analyze."
10
+ @count += 1
11
+ end
12
+ end
13
+
14
+ unless ENV['NO_EXIT_HANDLER']
15
+ Kernel.at_exit do
16
+ BleakHouse.hook
17
+ end
18
+ STDERR.puts "** Bleakhouse: installed"
19
+ end
20
+
21
+ Kernel.trap("USR2") do
22
+ BleakHouse.hook
23
+ end
24
+
25
+
@@ -0,0 +1,358 @@
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) {