diff options
author | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2014-04-20 09:01:04 +0000 |
---|---|---|
committer | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2014-04-20 09:01:04 +0000 |
commit | 6ecf40e1fa1b2c55f63d0ccb46bce2fca73b40ad (patch) | |
tree | 368a0326bcf36bc7e06cbbe7a1d55b752afd86ba /string.c | |
parent | cb3ea602294b5038b5f7ac21d3875a2b52342956 (diff) | |
parent | 680d09b61ea7d850e27944311723a40c596e5d95 (diff) | |
download | ruby-baserock/ps/proto-web-system.tar.gz |
Merge commit '680d09' into baserock/ps/proto-web-systembaserock/ps/proto-web-system
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1337,6 +1337,7 @@ rb_str_modify_expand(VALUE str, long expand) long capa = len + expand; if (!STR_EMBED_P(str)) { REALLOC_N(RSTRING(str)->as.heap.ptr, char, capa+1); + STR_UNSET_NOCAPA(str); RSTRING(str)->as.heap.aux.capa = capa; } else if (capa > RSTRING_EMBED_LEN_MAX) { @@ -1751,6 +1752,13 @@ rb_str_unlocktmp(VALUE str) return str; } +VALUE +rb_str_locktmp_ensure(VALUE str, VALUE (*func)(VALUE), VALUE arg) +{ + rb_str_locktmp(str); + return rb_ensure(func, arg, rb_str_unlocktmp, str); +} + void rb_str_set_len(VALUE str, long len) { @@ -7512,7 +7520,7 @@ sym_to_sym(VALUE sym) } static VALUE -sym_call(VALUE args, VALUE sym, int argc, VALUE *argv) +sym_call(VALUE args, VALUE sym, int argc, VALUE *argv, VALUE passed_proc) { VALUE obj; @@ -7520,7 +7528,7 @@ sym_call(VALUE args, VALUE sym, int argc, VALUE *argv) rb_raise(rb_eArgError, "no receiver given"); } obj = argv[0]; - return rb_funcall_passing_block(obj, (ID)sym, argc - 1, argv + 1); + return rb_funcall_with_block(obj, (ID)sym, argc - 1, argv + 1, passed_proc); } /* |