Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d5cdc866d5f9
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bd4d30583a84
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Jul 17, 2016

  1. Copy the full SHA
    37e5660 View commit details
  2. Copy the full SHA
    bd4d305 View commit details
Showing with 13 additions and 5 deletions.
  1. +2 −0 lib/ruby/truffle/cext/ruby.h
  2. +0 −4 spec/ruby/optional/capi/ext/jruby_truffle.h
  3. +0 −1 spec/truffle/tags/optional/capi/array_tags.txt
  4. +11 −0 truffle/src/main/c/cext/ruby.c
2 changes: 2 additions & 0 deletions lib/ruby/truffle/cext/ruby.h
Original file line number Diff line number Diff line change
@@ -133,6 +133,7 @@ VALUE rb_ary_new_capa(long capacity);
#define rb_ary_new2 rb_ary_new_capa
VALUE rb_ary_new_from_args(long n, ...);
#define rb_ary_new3 rb_ary_new_from_args
VALUE rb_ary_new4(long n, const VALUE *values);
VALUE rb_ary_push(VALUE array, VALUE value);
VALUE rb_ary_pop(VALUE array);
void rb_ary_store(VALUE array, long index, VALUE value);
@@ -249,6 +250,7 @@ VALUE rb_complex_set_imag(VALUE complex, VALUE imag);

// GC

void rb_gc_register_address(VALUE *address);
VALUE rb_gc_enable();
VALUE rb_gc_disable();

4 changes: 0 additions & 4 deletions spec/ruby/optional/capi/ext/jruby_truffle.h
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@
#undef HAVE_RB_ARY_FREEZE
#undef HAVE_RB_ARY_INCLUDES
#undef HAVE_RB_ARY_JOIN
#undef HAVE_RB_ARY_NEW4
#undef HAVE_RB_ARY_REVERSE
#undef HAVE_RB_ARY_SHIFT
#undef HAVE_RB_ARY_CONCAT
@@ -312,9 +311,6 @@
#undef HAVE_RB_FUNCALL3
#undef HAVE_RB_FUNCALL_WITH_BLOCK

/* GC */
#undef HAVE_RB_GC_REGISTER_ADDRESS

/* Marshal */
#undef HAVE_RB_MARSHAL_DUMP
#undef HAVE_RB_MARSHAL_LOAD
1 change: 0 additions & 1 deletion spec/truffle/tags/optional/capi/array_tags.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
fails:C-API Array function rb_Array returns obj wrapped in an array if it cannot be converted to an array
fails:C-API Array function rb_ary_new4 returns returns an array with the passed values
fails:C-API Array function rb_ary_join joins elements of an array with a string
fails:C-API Array function rb_ary_to_s creates an Array literal representation as a String
11 changes: 11 additions & 0 deletions truffle/src/main/c/cext/ruby.c
Original file line number Diff line number Diff line change
@@ -222,6 +222,14 @@ VALUE rb_ary_new_from_args(long n, ...) {
return array;
}

VALUE rb_ary_new4(long n, const VALUE *values) {
VALUE array = rb_ary_new_capa(n);
for (int i = 0; i < n; i++) {
rb_ary_store(array, i, values[i]);
}
return array;
}

VALUE rb_ary_push(VALUE array, VALUE value) {
truffle_invoke(array, "push", value);
return array;
@@ -484,6 +492,9 @@ VALUE rb_mutex_synchronize(VALUE mutex, VALUE (*func)(VALUE arg), VALUE arg) {

// GC

void rb_gc_register_address(VALUE *address) {
}

VALUE rb_gc_enable() {
return truffle_invoke(RUBY_CEXT, "rb_gc_enable");
}