diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-20 07:23:55 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-20 07:23:55 +0000 |
commit | e7c0a6e1d745935460a226cd5f29e2f0faff5417 (patch) | |
tree | 29840d1c3aa365cd3811d191370477c35474d37e /variable.c | |
parent | 4ab39d2202c42d3781e44ad8b8219e6e5bfa39aa (diff) | |
download | ruby-e7c0a6e1d745935460a226cd5f29e2f0faff5417.tar.gz |
* prevent temporary objects from GC, and should not use
RSTRING_PTR() for function calls since it evaluates the argument
a couple of times.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/variable.c b/variable.c index cd3318616e..505758c0c0 100644 --- a/variable.c +++ b/variable.c @@ -312,7 +312,8 @@ rb_class_name(VALUE klass) const char * rb_class2name(VALUE klass) { - return RSTRING_PTR(rb_class_name(klass)); + VALUE name = rb_class_name(klass); + return RSTRING_PTR(name); } const char * |