object.c: suppress warning
* object.c (rb_obj_alloc): suppress unused variable warning. * tool/gen_dummy_probes.rb: define dtrace disabling macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ed86cd0536
commit
7bd638b7a4
2
object.c
2
object.c
@ -1686,12 +1686,14 @@ rb_obj_alloc(VALUE klass)
|
|||||||
klass);
|
klass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(DTRACE_PROBES_DISABLED) || !DTRACE_PROBES_DISABLED
|
||||||
if (RUBY_DTRACE_OBJECT_CREATE_ENABLED()) {
|
if (RUBY_DTRACE_OBJECT_CREATE_ENABLED()) {
|
||||||
const char * file = rb_sourcefile();
|
const char * file = rb_sourcefile();
|
||||||
RUBY_DTRACE_OBJECT_CREATE(rb_class2name(klass),
|
RUBY_DTRACE_OBJECT_CREATE(rb_class2name(klass),
|
||||||
file ? file : "",
|
file ? file : "",
|
||||||
rb_sourceline());
|
rb_sourceline());
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
obj = (*allocator)(klass);
|
obj = (*allocator)(klass);
|
||||||
|
|
||||||
|
3
tool/gen_dummy_probes.rb
Normal file → Executable file
3
tool/gen_dummy_probes.rb
Normal file → Executable file
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/ruby
|
#!/usr/bin/ruby
|
||||||
|
# -*- coding: us-ascii -*-
|
||||||
|
|
||||||
text = ARGF.read
|
text = ARGF.read
|
||||||
text.upcase!
|
text.upcase!
|
||||||
@ -7,7 +8,7 @@ text.upcase!
|
|||||||
text.gsub!(/^#PRAGMA.*$/, '')
|
text.gsub!(/^#PRAGMA.*$/, '')
|
||||||
|
|
||||||
# replace the provider section with the start of the header file
|
# replace the provider section with the start of the header file
|
||||||
text.gsub!(/PROVIDER RUBY \{/, "#ifndef\t_PROBES_H\n#define\t_PROBES_H")
|
text.gsub!(/PROVIDER RUBY \{/, "#ifndef\t_PROBES_H\n#define\t_PROBES_H\n#define DTRACE_PROBES_DISABLED 1\n")
|
||||||
|
|
||||||
# finish up the #ifndef sandwich
|
# finish up the #ifndef sandwich
|
||||||
text.gsub!(/\};/, "#endif\t/* _PROBES_H */")
|
text.gsub!(/\};/, "#endif\t/* _PROBES_H */")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user