bleak_house 4.4 → 4.5

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.5. Enable SET_CURRENT_SOURCE() for better reporting (tmm1, joedamato).
3
+
2
4
  v4.4. Switch to Ruby 1.8.7p174.
3
5
 
4
6
  v4.3. Build against OpenSSL 0.9.8j or later (kennethkalmer). Bugfixes (Pete Hodgson, joshuabates).
data/Manifest CHANGED
@@ -14,10 +14,8 @@ ext/snapshot.h
14
14
  lib/bleak_house.rb
15
15
  lib/bleak_house/analyzer.rb
16
16
  lib/bleak_house/hook.rb
17
- ruby/openssl.patch
18
17
  ruby/ruby-1.8.7-p174.tar.bz2
19
- ruby/ruby187.patch
20
- ruby/valgrind.patch
18
+ ruby/ruby-1.8.7.patch
21
19
  test/benchmark/bench.rb
22
20
  test/test_helper.rb
23
21
  test/unit/test_bleak_house.rb
data/README CHANGED
@@ -87,11 +87,13 @@ You can send <tt>SIGUSR2</tt> to a BleakHouse-instrumented program to snag a dum
87
87
 
88
88
  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.
89
89
 
90
- 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:
90
+ 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 sometimes track <tt>eval()</tt> by using sourceline macros in your code:
91
91
 
92
92
  eval("CODE", nil, __FILE__, __LINE__)
93
93
 
94
- You may get library require errors if you install <tt>ruby-bleak-house</tt> 1.8.6 alongside a different verson of Ruby. You could try to patch your local version of Ruby instead, or you could just upgrade to 1.8.6, which has a good trackrecord of stability.
94
+ You may get library require errors if you install <tt>ruby-bleak-house</tt> 1.8.7 alongside a different verson of Ruby. You could try to patch your local version of Ruby instead, or you can get <tt>ruby-bleak-house</tt> to lie about its version. Just make sure that the <tt>bleak-house</tt> library is the first thing required (even before Rubygems):
95
+
96
+ ruby-bleak-house -I `ruby -e 'puts \`gem which bleak_house\`.split("\n")[1][0..-16]'` -rbleak_house
95
97
 
96
98
  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.
97
99
 
data/bleak_house.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{bleak_house}
5
- s.version = "4.4"
5
+ s.version = "4.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Evan Weaver"]
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.executables = ["bleak"]
15
15
  s.extensions = ["ext/extconf.rb"]
16
16
  s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "LICENSE_BSD", "README", "TODO", "ext/snapshot.c", "lib/bleak_house.rb", "lib/bleak_house/analyzer.rb", "lib/bleak_house/hook.rb"]
17
- s.files = ["CHANGELOG", "LICENSE", "LICENSE_BSD", "Manifest", "README", "Rakefile", "TODO", "bin/bleak", "ext/build_ruby.rb", "ext/build_snapshot.rb", "ext/extconf.rb", "ext/snapshot.c", "ext/snapshot.h", "lib/bleak_house.rb", "lib/bleak_house/analyzer.rb", "lib/bleak_house/hook.rb", "ruby/openssl.patch", "ruby/ruby-1.8.7-p174.tar.bz2", "ruby/ruby187.patch", "ruby/valgrind.patch", "test/benchmark/bench.rb", "test/test_helper.rb", "test/unit/test_bleak_house.rb", "bleak_house.gemspec"]
17
+ s.files = ["CHANGELOG", "LICENSE", "LICENSE_BSD", "Manifest", "README", "Rakefile", "TODO", "bin/bleak", "ext/build_ruby.rb", "ext/build_snapshot.rb", "ext/extconf.rb", "ext/snapshot.c", "ext/snapshot.h", "lib/bleak_house.rb", "lib/bleak_house/analyzer.rb", "lib/bleak_house/hook.rb", "ruby/ruby-1.8.7-p174.tar.bz2", "ruby/ruby-1.8.7.patch", "test/benchmark/bench.rb", "test/test_helper.rb", "test/unit/test_bleak_house.rb", "bleak_house.gemspec"]
18
18
  s.homepage = %q{http://blog.evanweaver.com/files/doc/fauna/bleak_house/}
19
19
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Bleak_house", "--main", "README"]
20
20
  s.require_paths = ["lib", "ext"]
data/ext/build_ruby.rb CHANGED
@@ -1,13 +1,7 @@
1
1
 
2
2
  # Extension abuse in order to build our patched binary as part of the gem install process.
3
3
 
4
- if RUBY_PLATFORM =~ /win32|windows/
5
- raise "Windows is not supported."
6
- end
7
-
8
- unless RUBY_VERSION == '1.8.7'
9
- raise "Wrong Ruby version, you're at '#{RUBY_VERSION}', need 1.8.7"
10
- end
4
+ raise "Windows is not supported." if RUBY_PLATFORM =~ /win32|windows/
11
5
 
12
6
  source_dir = File.expand_path(File.dirname(__FILE__)) + "/../ruby"
13
7
  tmp = "/tmp/"
@@ -32,7 +26,7 @@ def which(basename)
32
26
  end
33
27
 
34
28
  if which('ruby-bleak-house') and
35
- (patchlevel = `ruby-bleak-house -e "puts RUBY_PATCHLEVEL"`.to_i) >= 904
29
+ (patchlevel = `ruby-bleak-house -e "puts RUBY_PATCHLEVEL"`.to_i) >= 905
36
30
  puts "** Binary `ruby-bleak-house` is already available (patchlevel #{patchlevel})"
37
31
  else
38
32
  # Build
@@ -60,7 +54,7 @@ else
60
54
  Dir.chdir("ruby-1.8.7-p174") do
61
55
 
62
56
  puts "** Patch Ruby"
63
- execute("patch -p1 < '#{source_dir}/ruby187.patch'")
57
+ execute("patch -p1 < '#{source_dir}/ruby-1.8.7.patch'")
64
58
 
65
59
  env = Config::CONFIG.map do |key, value|
66
60
  "#{key}=#{value.inspect}" if key.upcase == key and value
@@ -1,3 +1,4 @@
1
+ RUBY_VERSION = `ruby -v`.split(" ")[1]
1
2
  require 'mkmf'
2
3
  $CFLAGS = ENV['CFLAGS']
3
4
  dir_config('snapshot')
data/lib/bleak_house.rb CHANGED
@@ -1,7 +1,8 @@
1
1
 
2
- unless RUBY_PATCHLEVEL >= 904
2
+ unless RUBY_PATCHLEVEL >= 905
3
3
  raise "This build of Ruby has not been successfully patched for BleakHouse."
4
4
  end
5
5
 
6
+ RUBY_VERSION = `ruby -v`.split(" ")[1]
6
7
  require 'snapshot'
7
8
  require 'bleak_house/hook'
@@ -290,6 +290,15 @@ index 11264f7..09ec7a6 100644
290
290
  #include <stdio.h>
291
291
 
292
292
  #include "st.h"
293
+ @@ -1149,7 +1149,7 @@ static VALUE trace_func = 0;
294
+ static int tracing = 0;
295
+ static void call_trace_func _((rb_event_t,NODE*,VALUE,ID,VALUE));
296
+
297
+ -#if 0
298
+ +#if 1
299
+ #define SET_CURRENT_SOURCE() (ruby_sourcefile = ruby_current_node->nd_file, \
300
+ ruby_sourceline = nd_line(ruby_current_node))
301
+ #else
293
302
  @@ -5290,6 +5296,9 @@ assign(self, lhs, val, pcall)
294
303
  int pcall;
295
304
  {
@@ -370,18 +379,17 @@ index 45facf0..933b76e 100644
370
379
  #define HEAP_MIN_SLOTS 10000
371
380
  static int heap_slots = HEAP_MIN_SLOTS;
372
381
 
373
- @@ -442,6 +463,11 @@ rb_newobj()
382
+ @@ -438,10 +438,8 @@ rb_newobj()
383
+ obj = (VALUE)freelist;
384
+ freelist = freelist->as.free.next;
385
+ MEMZERO((void*)obj, RVALUE, 1);
386
+ -#ifdef GC_DEBUG
374
387
  RANY(obj)->file = ruby_sourcefile;
375
388
  RANY(obj)->line = ruby_sourceline;
376
- #endif
377
- +
378
- + if (ruby_current_node && ruby_current_node->nd_file) {
379
- + RANY(obj)->file = ruby_current_node->nd_file;
380
- + RANY(obj)->line = nd_line(ruby_current_node);
381
- + }
389
+ -#endif
382
390
  return obj;
383
391
  }
384
-
392
+
385
393
  @@ -678,6 +704,9 @@ mark_locations_array(x, n)
386
394
  register long n;
387
395
  {
@@ -411,6 +419,28 @@ index 45facf0..933b76e 100644
411
419
  if (lev > GC_LEVEL_MAX || (lev == 0 && ruby_stack_check())) {
412
420
  if (!mark_stack_overflow) {
413
421
  if (mark_stack_ptr - mark_stack < MARK_STACK_MAX) {
422
+ @@ -1077,6 +1078,10 @@ gc_mark(ptr, lev)
423
+ if (obj->as.basic.flags == 0) return; /* free cell */
424
+ if (obj->as.basic.flags & FL_MARK) return; /* already marked */
425
+ obj->as.basic.flags |= FL_MARK;
426
+ +
427
+ + /* mark our new reference point for sourcefile objects */
428
+ + mark_source_filename(RANY(obj)->file);
429
+ +
430
+
431
+ if (lev > GC_LEVEL_MAX || (lev == 0 && ruby_stack_check())) {
432
+ if (!mark_stack_overflow) {
433
+ @@ -1115,6 +1120,10 @@ gc_mark_children(ptr, lev)
434
+ if (obj->as.basic.flags == 0) return; /* free cell */
435
+ if (obj->as.basic.flags & FL_MARK) return; /* already marked */
436
+ obj->as.basic.flags |= FL_MARK;
437
+ +
438
+ + /* mark our new reference point for sourcefile objects */
439
+ + mark_source_filename(RANY(obj)->file);
440
+ +
441
+
442
+ marking:
443
+ if (FL_TEST(obj, FL_EXIVAR)) {
414
444
  diff --git a/parse.c b/parse.c
415
445
  index 6b3d80d..b320cf2 100644
416
446
  --- a/parse.c
@@ -449,5 +479,5 @@ index 70fc28a..76aa188 100644
449
479
  +++ b/version.h
450
480
  @@ -5,2 +5,2 @@
451
481
  -#define RUBY_PATCHLEVEL 174
452
- +#define RUBY_PATCHLEVEL 904
482
+ +#define RUBY_PATCHLEVEL 905
453
483
 
@@ -3,10 +3,10 @@ $LOAD_PATH.unshift(File.dirname(__FILE__) + "/../../lib")
3
3
 
4
4
  ENV['NO_EXIT_HANDLER'] = "1"
5
5
 
6
+ require 'bleak_house'
6
7
  require 'rubygems'
7
8
  require 'echoe'
8
9
  require 'test/unit'
9
- require 'bleak_house'
10
10
 
11
11
  class BleakHouseTest < Test::Unit::TestCase
12
12
 
@@ -38,7 +38,7 @@ class BleakHouseTest < Test::Unit::TestCase
38
38
  # require 'ruby-debug/debugger'
39
39
  assert_match(/top 20 most common/, output[0])
40
40
  assert_match(/free heap/, output[3])
41
- assert_match(/\d+ __null__:__null__:__node__/, output[4])
41
+ assert_match(/\d+ __null__:__null__:__node__/, output[5])
42
42
  end
43
43
  end
44
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.4"
4
+ version: "4.5"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Weaver
@@ -67,10 +67,8 @@ files:
67
67
  - lib/bleak_house.rb
68
68
  - lib/bleak_house/analyzer.rb
69
69
  - lib/bleak_house/hook.rb
70
- - ruby/openssl.patch
71
70
  - ruby/ruby-1.8.7-p174.tar.bz2
72
- - ruby/ruby187.patch
73
- - ruby/valgrind.patch
71
+ - ruby/ruby-1.8.7.patch
74
72
  - test/benchmark/bench.rb
75
73
  - test/test_helper.rb
76
74
  - test/unit/test_bleak_house.rb
metadata.gz.sig CHANGED
Binary file
data/ruby/openssl.patch DELETED
@@ -1,157 +0,0 @@
1
- This patch backports changes from ruby 1.8.7 which only includes the
2
- openssl prototypes for functions that are not in the system openssl
3
- library. This fixes #254307 and protects against similar issues with
4
- future openssl versions.
5
-
6
- diff -u ruby-1.8.6_p287-r10/work/ruby-1.8.6-p287/ext/openssl/extconf.rb ruby-1.8.7_p72-r1/work/ruby-1.8.7-p72/ext/openssl/extconf.rb
7
- --- ruby-1.8.6_p287-r10/work/ruby-1.8.6-p287/ext/openssl/openssl_missing.c 2007-02-13 00:01:19.000000000 +0100
8
- +++ ruby-1.8.7_p72-r1/work/ruby-1.8.7-p72/ext/openssl/openssl_missing.c 2008-05-19 05:00:52.000000000 +0200
9
- @@ -22,17 +22,15 @@
10
- #include "openssl_missing.h"
11
-
12
- #if !defined(HAVE_HMAC_CTX_COPY)
13
- -int
14
- +void
15
- HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in)
16
- {
17
- - if (!out || !in) return 0;
18
- + if (!out || !in) return;
19
- memcpy(out, in, sizeof(HMAC_CTX));
20
-
21
- - if (!EVP_MD_CTX_copy(&out->md_ctx, &in->md_ctx)
22
- - || !EVP_MD_CTX_copy(&out->i_ctx, &in->i_ctx)
23
- - || !EVP_MD_CTX_copy(&out->o_ctx, &in->o_ctx))
24
- - return 0;
25
- - return 1;
26
- + EVP_MD_CTX_copy(&out->md_ctx, &in->md_ctx);
27
- + EVP_MD_CTX_copy(&out->i_ctx, &in->i_ctx);
28
- + EVP_MD_CTX_copy(&out->o_ctx, &in->o_ctx);
29
- }
30
- #endif /* HAVE_HMAC_CTX_COPY */
31
- #endif /* NO_HMAC */
32
- diff -u ruby-1.8.6_p287-r10/work/ruby-1.8.6-p287/ext/openssl/openssl_missing.h ruby-1.8.7_p72-r1/work/ruby-1.8.7-p72/ext/openssl/openssl_missing.h
33
- --- ruby-1.8.6_p287-r10/work/ruby-1.8.6-p287/ext/openssl/openssl_missing.h 2008-08-04 06:43:34.000000000 +0200
34
- +++ ruby-1.8.7_p72-r1/work/ruby-1.8.7-p72/ext/openssl/openssl_missing.h 2008-08-04 06:44:17.000000000 +0200
35
- @@ -60,14 +60,33 @@
36
- (char *(*)())d2i_PKCS7_RECIP_INFO, (char *)ri)
37
- #endif
38
-
39
- +#if !defined(HAVE_EVP_MD_CTX_INIT)
40
- void HMAC_CTX_init(HMAC_CTX *ctx);
41
- -int HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
42
- +#endif
43
- +
44
- +#if !defined(HAVE_HMAC_CTX_COPY)
45
- +void HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
46
- +#endif
47
- +
48
- +#if !defined(HAVE_HMAC_CTX_CLEANUP)
49
- void HMAC_CTX_cleanup(HMAC_CTX *ctx);
50
- +#endif
51
-
52
- +#if !defined(HAVE_EVP_MD_CTX_CREATE)
53
- EVP_MD_CTX *EVP_MD_CTX_create(void);
54
- +#endif
55
- +
56
- +#if !defined(HAVE_EVP_MD_CTX_INIT)
57
- void EVP_MD_CTX_init(EVP_MD_CTX *ctx);
58
- +#endif
59
- +
60
- +#if !defined(HAVE_EVP_MD_CTX_CLEANUP)
61
- int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx);
62
- +#endif
63
- +
64
- +#if !defined(HAVE_EVP_MD_CTX_DESTROY)
65
- void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);
66
- +#endif
67
-
68
- #if !defined(HAVE_EVP_CIPHER_CTX_COPY)
69
- int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in);
70
- @@ -111,19 +130,54 @@
71
- #define OPENSSL_cleanse(p, l) memset(p, 0, l)
72
- #endif
73
-
74
- +#if !defined(HAVE_X509_STORE_SET_EX_DATA)
75
- void *X509_STORE_get_ex_data(X509_STORE *str, int idx);
76
- int X509_STORE_set_ex_data(X509_STORE *str, int idx, void *data);
77
- +#endif
78
- +
79
- +#if !defined(HAVE_X509_CRL_SET_VERSION)
80
- int X509_CRL_set_version(X509_CRL *x, long version);
81
- +#endif
82
- +
83
- +#if !defined(HAVE_X509_CRL_SET_ISSUER_NAME)
84
- int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
85
- +#endif
86
- +
87
- +#if !defined(HAVE_X509_CRL_SORT)
88
- int X509_CRL_sort(X509_CRL *c);
89
- +#endif
90
- +
91
- +#if !defined(HAVE_X509_CRL_ADD0_REVOKED)
92
- int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
93
- +#endif
94
- +
95
- +#if !defined(HAVE_BN_MOD_SQR)
96
- int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
97
- +#endif
98
- +
99
- +#if !defined(HAVE_BN_MOD_ADD)
100
- int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
101
- +#endif
102
- +
103
- +#if !defined(HAVE_BN_MOD_SUB)
104
- int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
105
- +#endif
106
- +
107
- +#if !defined(HAVE_BN_RAND_RANGE)
108
- int BN_rand_range(BIGNUM *r, BIGNUM *range);
109
- +#endif
110
- +
111
- +#if !defined(HAVE_BN_PSEUDO_RAND_RANGE)
112
- int BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range);
113
- +#endif
114
- +
115
- +#if !defined(HAVE_CONF_GET1_DEFAULT_CONFIG_FILE)
116
- char *CONF_get1_default_config_file(void);
117
- +#endif
118
- +
119
- +#if !defined(HAVE_PEM_DEF_CALLBACK)
120
- int PEM_def_callback(char *buf, int num, int w, void *key);
121
- +#endif
122
-
123
- #if defined(__cplusplus)
124
- }
125
- diff -u ruby-1.8.6_p287-r10/work/ruby-1.8.6-p287/ext/openssl/ossl_hmac.c ruby-1.8.7_p72-r1/work/ruby-1.8.7-p72/ext/openssl/ossl_hmac.c
126
- --- ruby-1.8.6_p287-r10/work/ruby-1.8.6-p287/ext/openssl/ossl_hmac.c 2007-03-12 05:12:32.000000000 +0100
127
- +++ ruby-1.8.7_p72-r1/work/ruby-1.8.7-p72/ext/openssl/ossl_hmac.c 2008-05-19 05:00:52.000000000 +0200
128
- @@ -81,12 +87,15 @@
129
- GetHMAC(self, ctx1);
130
- SafeGetHMAC(other, ctx2);
131
-
132
- - if (!HMAC_CTX_copy(ctx1, ctx2)) {
133
- - ossl_raise(eHMACError, NULL);
134
- - }
135
- + HMAC_CTX_copy(ctx1, ctx2);
136
- return self;
137
- }
138
-
139
- +/*
140
- + * call-seq:
141
- + * hmac.update(string) -> self
142
- + *
143
- + */
144
- static VALUE
145
- ossl_hmac_update(VALUE self, VALUE data)
146
- {
147
- @@ -104,9 +113,7 @@
148
- {
149
- HMAC_CTX final;
150
-
151
- - if (!HMAC_CTX_copy(&final, ctx)) {
152
- - ossl_raise(eHMACError, NULL);
153
- - }
154
- + HMAC_CTX_copy(&final, ctx);
155
- if (!(*buf = OPENSSL_malloc(HMAC_size(&final)))) {
156
- HMAC_CTX_cleanup(&final);
157
- OSSL_Debug("Allocating %d mem", HMAC_size(&final));
data/ruby/valgrind.patch DELETED
@@ -1,123 +0,0 @@
1
- Index: Makefile.in
2
- ===================================================================
3
- --- Makefile.in (revision 6439)
4
- +++ Makefile.in (working copy)
5
- @@ -34,7 +34,7 @@
6
-
7
- empty =
8
- OUTFLAG = @OUTFLAG@$(empty)
9
- -CFLAGS = @CFLAGS@ @XCFLAGS@ @ARCH_FLAG@
10
- +CFLAGS = @CFLAGS@ @XCFLAGS@ @ARCH_FLAG@ @VALGRIND_CFLAGS@
11
- CPPFLAGS = -I. -I$(srcdir) @CPPFLAGS@
12
- LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
13
- EXTLDFLAGS =
14
- Index: configure.in
15
- ===================================================================
16
- --- configure.in (revision 6439)
17
- +++ configure.in (working copy)
18
- @@ -895,6 +895,22 @@
19
- fi
20
- fi
21
-
22
- +AC_ARG_ENABLE(valgrind,
23
- + [ --enable-valgrind use valgrind support],
24
- + [want_valgrind=$enableval], [want_valgrind=auto])
25
- +
26
- +if test x"$want_valgrind" != xno; then
27
- + AC_CHECK_HEADERS(valgrind/memcheck.h, have_valgrind=yes, have_valgrind=no)
28
- + if test x"$have_valgrind" = xyes; then
29
- + AC_DEFINE(HAVE_VALGRIND)
30
- + VALGRIND_CFLAGS="";
31
- + elif test x"$want_valgrind" = xyes -a x"$have_valgrind" = xno; then
32
- + AC_MSG_ERROR(valgrind support requested but valgrind not found)
33
- + else
34
- + VALGRIND_CFLAGS="";
35
- + fi
36
- +fi
37
- +
38
- dnl default value for $KANJI
39
- DEFAULT_KCODE="KCODE_NONE"
40
-
41
- @@ -1504,6 +1520,7 @@
42
- esac
43
-
44
- AC_SUBST(XCFLAGS)dnl
45
- +AC_SUBST(VALGRIND_CFLAGS)dnl
46
- AC_SUBST(XLDFLAGS)dnl
47
- AC_SUBST(LIBRUBY_LDSHARED)
48
- AC_SUBST(LIBRUBY_DLDFLAGS)
49
- Index: eval.c
50
- ===================================================================
51
- --- eval.c (revision 6439)
52
- +++ eval.c (working copy)
53
- @@ -28,6 +28,12 @@
54
- #define EXIT_FAILURE 1
55
- #endif
56
-
57
- +#ifdef HAVE_VALGRIND
58
- +#include <valgrind/memcheck.h>
59
- +#else
60
- +#define VALGRIND_MAKE_MEM_DEFINED(p, n) /* empty */
61
- +#endif
62
- +
63
- #include <stdio.h>
64
-
65
- #include "st.h"
66
- @@ -5225,6 +5231,9 @@
67
- int pcall;
68
- {
69
- ruby_current_node = lhs;
70
- +
71
- + VALGRIND_MAKE_MEM_DEFINED(&val, sizeof(val));
72
- +
73
- if (val == Qundef) {
74
- rb_warning("assigning void value");
75
- val = Qnil;
76
- Index: gc.c
77
- ===================================================================
78
- --- gc.c (revision 6439)
79
- +++ gc.c (working copy)
80
- @@ -30,6 +30,12 @@
81
- #include <sys/resource.h>
82
- #endif
83
-
84
- +#ifdef HAVE_VALGRIND
85
- +#include <valgrind/memcheck.h>
86
- +#else
87
- +#define VALGRIND_MAKE_MEM_DEFINED(p, n) /* empty */
88
- +#endif
89
- +
90
- #if defined _WIN32 || defined __CYGWIN__
91
- #include <windows.h>
92
- #endif
93
- @@ -93,6 +99,9 @@
94
- {
95
- void *mem;
96
-
97
- + VALGRIND_MAKE_MEM_DEFINED(&malloc_increase, sizeof(malloc_increase));
98
- + VALGRIND_MAKE_MEM_DEFINED(&malloc_limit, sizeof(malloc_limit));
99
- +
100
- if (size < 0) {
101
- rb_raise(rb_eNoMemError, "negative allocation size (or too big)");
102
- }
103
- @@ -623,6 +632,9 @@
104
- register long n;
105
- {
106
- VALUE v;
107
- +
108
- + VALGRIND_MAKE_MEM_DEFINED(x, sizeof(*x) * n);
109
- +
110
- while (n--) {
111
- v = *x;
112
- if (is_pointer_to_heap((void *)v)) {
113
- @@ -713,7 +725,10 @@
114
- {
115
- register RVALUE *obj;
116
-
117
- + VALGRIND_MAKE_MEM_DEFINED(&ptr, sizeof(ptr));
118
- obj = RANY(ptr);
119
- + VALGRIND_MAKE_MEM_DEFINED(obj, sizeof(*obj));
120
- +
121
- if (rb_special_const_p(ptr)) return; /* special const not marked */
122
- if (obj->as.basic.flags == 0) return; /* free cell */
123
- if (obj->as.basic.flags & FL_MARK) return; /* already marked */