summaryrefslogtreecommitdiff
path: root/symbol.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-29 05:32:57 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-29 05:32:57 +0000
commit645116ff25e42b1cfb065ad98e13818c8c5c2a8d (patch)
tree47ed734b95ca72ec176b056b766a0561ef441723 /symbol.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 'symbol.c')
-rw-r--r--symbol.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/symbol.c b/symbol.c
index f0ba5e7f02..795c22d836 100644
--- a/symbol.c
+++ b/symbol.c
@@ -465,9 +465,7 @@ register_static_symid_str(ID id, VALUE str)
OBJ_FREEZE(str);
str = rb_fstring(str);
- if (RUBY_DTRACE_SYMBOL_CREATE_ENABLED()) {
- RUBY_DTRACE_SYMBOL_CREATE(RSTRING_PTR(str), rb_sourcefile(), rb_sourceline());
- }
+ RUBY_DTRACE_CREATE_HOOK(SYMBOL, RSTRING_PTR(str));
register_sym(str, sym);
set_id_entry(num, str, sym);
@@ -534,9 +532,7 @@ dsymbol_alloc(const VALUE klass, const VALUE str, rb_encoding * const enc, const
register_sym(str, dsym);
rb_hash_aset(global_symbols.dsymbol_fstr_hash, str, Qtrue);
- if (RUBY_DTRACE_SYMBOL_CREATE_ENABLED()) {
- RUBY_DTRACE_SYMBOL_CREATE(RSTRING_PTR(RSYMBOL(dsym)->fstr), rb_sourcefile(), rb_sourceline());
- }
+ RUBY_DTRACE_CREATE_HOOK(SYMBOL, RSTRING_PTR(RSYMBOL(dsym)->fstr));
return dsym;
}