ruby-changes:45337
From: naruse <ko1@a...>
Date: Tue, 24 Jan 2017 01:58:34 +0900 (JST)
Subject: [ruby-changes:45337] naruse:r57410 (trunk): Prevent GC by volatile [Bug #13150]
naruse 2017-01-24 01:58:27 +0900 (Tue, 24 Jan 2017) New Revision: 57410 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57410 Log: Prevent GC by volatile [Bug #13150] test/ruby/test_marshal.rb test_context_switch (load) and test_gc (dump) are failed on FreeBSD 10.3 and gcc7 (FreeBSD Ports Collection) 7.0.0 20170115 (experimental); RB_GC_GUARD looks not worked well. Modified files: trunk/marshal.c Index: marshal.c =================================================================== --- marshal.c (revision 57409) +++ marshal.c (revision 57410) @@ -1024,7 +1024,7 @@ VALUE https://github.com/ruby/ruby/blob/trunk/marshal.c#L1024 rb_marshal_dump_limited(VALUE obj, VALUE port, int limit) { struct dump_arg *arg; - VALUE wrapper; /* used to avoid memory leak in case of exception */ + volatile VALUE wrapper; /* used to avoid memory leak in case of exception */ wrapper = TypedData_Make_Struct(rb_cData, struct dump_arg, &dump_arg_data, arg); arg->dest = 0; @@ -2038,7 +2038,7 @@ rb_marshal_load_with_proc(VALUE port, VA https://github.com/ruby/ruby/blob/trunk/marshal.c#L2038 { int major, minor, infection = 0; VALUE v; - VALUE wrapper; /* used to avoid memory leak in case of exception */ + volatile VALUE wrapper; /* used to avoid memory leak in case of exception */ struct load_arg *arg; v = rb_check_string_type(port); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/