summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-30 03:21:56 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-30 03:21:56 +0000
commit54726befc3eb52bf06640bfb07664dace3721d14 (patch)
tree99766412fdcda4ec9e5d901e630475c90b56ec94 /thread_pthread.c
parentf7c0cc36920a4ed14a3ab1ca6cfdf18ceff1e5d5 (diff)
downloadruby-54726befc3eb52bf06640bfb07664dace3721d14.tar.gz
use RARRAY_AREF() instead of RARRAY_CONST_PTR().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 368dc0421c..648bf8f3d5 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1615,18 +1615,17 @@ native_set_thread_name(rb_thread_t *th)
SET_CURRENT_THREAD_NAME(RSTRING_PTR(loc));
}
else if (!NIL_P(loc = rb_proc_location(th->first_proc))) {
- const VALUE *ptr = RARRAY_CONST_PTR(loc); /* [ String, Integer ] */
char *name, *p;
char buf[16];
size_t len;
int n;
- name = RSTRING_PTR(ptr[0]);
+ name = RSTRING_PTR(RARRAY_AREF(loc, 0));
p = strrchr(name, '/'); /* show only the basename of the path. */
if (p && p[1])
name = p + 1;
- n = snprintf(buf, sizeof(buf), "%s:%d", name, NUM2INT(ptr[1]));
+ n = snprintf(buf, sizeof(buf), "%s:%d", name, NUM2INT(RARRAY_AREF(loc, 1)));
rb_gc_force_recycle(loc); /* acts as a GC guard, too */
len = (size_t)n;