Skip to content

Commit 5c88dc5

Browse files
committed
Reduce conversion of VALUEs to native handles.
1 parent b29826b commit 5c88dc5

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Performance:
3838
* Optimize `Dir[]` by sorting entries as they are found and grouping syscalls (#2092, @aardvark179).
3939
* Reduce memory footprint by tracking `VALUE`s created during C extension init separately (@aardvark179).
4040
* Rewrote `ArrayEachIteratorNode` to optimize performance for a constant-sized array and reduce specializations to 1 general case (#2587, @MattAlp)
41+
* Reduce conversion of `VALUE`s to native handle during common operations in C extensions (@aardvark179).
4142

4243
Changes:
4344

lib/cext/ABI_version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12
1+
13

lib/cext/include/truffleruby/truffleruby.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,13 @@ static inline VALUE rb_tr_string_value(VALUE *value_pointer) {
185185

186186
ALWAYS_INLINE(static char *rb_tr_string_value_ptr(VALUE *value_pointer));
187187
static inline char *rb_tr_string_value_ptr(VALUE *value_pointer) {
188-
VALUE string = rb_string_value(value_pointer);
188+
VALUE string = rb_tr_string_value(value_pointer);
189189
return RSTRING_PTR(string);
190190
}
191191

192192
ALWAYS_INLINE(static char *rb_tr_string_value_cstr(VALUE *value_pointer));
193193
static inline char *rb_tr_string_value_cstr(VALUE *value_pointer) {
194-
VALUE string = rb_string_value(value_pointer);
194+
VALUE string = rb_tr_string_value(value_pointer);
195195
RUBY_CEXT_INVOKE("rb_string_value_cstr_check", string);
196196
return RSTRING_PTR(string);
197197
}

0 commit comments

Comments
 (0)