Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ruby: use rb_interned_str when available #12

Merged
merged 1 commit into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions contrib/ruby/ext/trilogy-ruby/cext.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,12 @@ static VALUE execute_read_query(VALUE vargs)
}
}

#ifdef HAVE_RB_INTERNED_STR
VALUE column_name = rb_interned_str(column.name, column.name_len);
#else
VALUE column_name = rb_str_new(column.name, column.name_len);
OBJ_FREEZE(column_name);
#endif

rb_ary_push(column_names, column_name);

Expand Down
1 change: 1 addition & 0 deletions contrib/ruby/ext/trilogy-ruby/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@

have_library("crypto", "CRYPTO_malloc")
have_library("ssl", "SSL_new")
have_func("rb_interned_str", "ruby.h")

create_makefile "trilogy/cext"