From 4a0d7f18fdd0b3c0d9aa45f73aed90be833e143f Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Sat, 17 Mar 2012 12:40:29 +0100 Subject: [PATCH] Explicitly state msgpack doesn't modify char* buffers from RSTRING_PTR From what I could investigate, msgpack doesn't modify char* buffers obtained from RSTRING_PTR. This means that on Rubinius we don't have to copy back and forth the buffer to make sure it's also updated on the Ruby side. This copying of buffers is a similar problem as the RARRAY_PTR problem, because it is not safe to expose GC'ed memory on Rubinius to extensions since it can move due to Rubinius having a moving GC. --- ruby/pack.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ruby/pack.c b/ruby/pack.c index 826f4e27..35717090 100644 --- a/ruby/pack.c +++ b/ruby/pack.c @@ -15,6 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#define RSTRING_NOT_MODIFIED #include "ruby.h" #include "compat.h"