summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-29 05:32:57 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-29 05:32:57 (GMT)
commit645116ff25e42b1cfb065ad98e13818c8c5c2a8d (patch)
tree47ed734b95ca72ec176b056b766a0561ef441723 /array.c
parent1be5cb6371048a35d9fb2859ca8a865e982608cf (diff)
RUBY_DTRACE_CREATE_HOOK
* internal.h (RUBY_DTRACE_CREATE_HOOK): macro to call hook at object creation. * vm.c (rb_source_location, rb_source_loc): retrieve source path and line number at once. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/array.c b/array.c
index 2faa315..eac927d 100644
--- a/array.c
+++ b/array.c
@@ -453,10 +453,7 @@ ary_alloc(VALUE klass)
static VALUE
empty_ary_alloc(VALUE klass)
{
- if (RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
- RUBY_DTRACE_ARRAY_CREATE(0, rb_sourcefile(), rb_sourceline());
- }
-
+ RUBY_DTRACE_CREATE_HOOK(ARRAY, 0);
return ary_alloc(klass);
}
@@ -472,9 +469,7 @@ ary_new(VALUE klass, long capa)
rb_raise(rb_eArgError, "array size too big");
}
- if (RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
- RUBY_DTRACE_ARRAY_CREATE(capa, rb_sourcefile(), rb_sourceline());
- }
+ RUBY_DTRACE_CREATE_HOOK(ARRAY, capa);
ary = ary_alloc(klass);
if (capa > RARRAY_EMBED_LEN_MAX) {