Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Use rb_ary_entry instead of RARRAY_PTR #877

Merged
merged 1 commit into from

2 participants

Dirkjan Bussink Lee Jarvis
Dirkjan Bussink

For MRI, this doesn't make a difference, but on Rubinius this prevents
having to setup a backing store for copying over the internal array
pointers. This was the only case where RARRAY_PTR was used, other places
already use rb_ary_entry, so it should be a good change for consistency
as well.

Dirkjan Bussink dbussink Use a rb_ary_entry and not RARRAY_PTR()
For MRI, this doesn't make a difference, but on Rubinius this prevents
having to setup a backing store for copying over the internal array
pointers. This was the only case where RARRAY_PTR was used, other places
already use rb_ary_entry, so it should be a good change for consistency
as well.
2affe7c
Dirkjan Bussink

Any way to get this merged? Or is there anything that would hold this back?

Lee Jarvis
Owner

@dbussink Getting a segfault on rbx-18mode. I'm happy to merge this once this runs green but @flavorjones might want to wait until after 1.6.0 is released

Dirkjan Bussink

I don't see how this could be related to the Rubinius segfault, since I actually changed this because it works better for Rubinius (and ran the tests locally). I guess they were due to some other issue that existed when I sent this pull request that has been fixed in the mean while.

Also this change is really minor, so don't really see how it would affect a release, but it's not my decision of course :).

Lee Jarvis
Owner

@dbussink I agree on both counts. I'll run this against travis again so it's running green, I'm happy to merge before the release :) will catch up with this later. Thanks

Lee Jarvis leejarvis merged commit ff9eeea into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 26, 2013
  1. Dirkjan Bussink

    Use a rb_ary_entry and not RARRAY_PTR()

    dbussink authored
    For MRI, this doesn't make a difference, but on Rubinius this prevents
    having to setup a backing store for copying over the internal array
    pointers. This was the only case where RARRAY_PTR was used, other places
    already use rb_ary_entry, so it should be a good change for consistency
    as well.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  ext/nokogiri/xslt_stylesheet.c
2  ext/nokogiri/xslt_stylesheet.c
View
@@ -209,7 +209,7 @@ static void * initFunc(xsltTransformContextPtr ctxt, const xmlChar *uri)
int i;
for(i = 0; i < RARRAY_LEN(methods); i++) {
- VALUE method_name = rb_obj_as_string(RARRAY_PTR(methods)[i]);
+ VALUE method_name = rb_obj_as_string(rb_ary_entry(methods, i));
xsltRegisterExtFunction(ctxt,
(unsigned char *)StringValuePtr(method_name), uri, method_caller);
}
Something went wrong with that request. Please try again.