summaryrefslogtreecommitdiff
path: root/marshal.c
AgeCommit message (Collapse)Author
2014-02-17marshal.c: do not recycle wrapper objectsnobu
* marshal.c (marshal_dump, marshal_load): do not recycle wrapper objects, to prevent from segfault with continuation. [ruby-dev:47970] [Bug #9523] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-16marshal.c: use rb_gc_force_recycle for GC-safetynormal
Putting rb_gc_force_recycle at the end of the function has a nice side-effect of keeping wrapper visible to GC until the moment of recycle, preventing GC from prematurely killing live objects. volatile is a common source of compiler bugs/differences, avoid it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-15* internal.h: Rename macro names: RBIGNUM_FOO to BIGNUM_FOO.akr
(BIGNUM_EMBED_LEN_NUMBITS): Renamed from RBIGNUM_EMBED_LEN_NUMBITS. (BIGNUM_EMBED_LEN_MAX): Renamed from RBIGNUM_EMBED_LEN_MAX. (BIGNUM_SIGN_BIT): Renamed from RBIGNUM_SIGN_BIT. (BIGNUM_SIGN): Renamed from RBIGNUM_SIGN. (BIGNUM_SET_SIGN): Renamed from RBIGNUM_SET_SIGN. (BIGNUM_POSITIVE_P): Renamed from RBIGNUM_POSITIVE_P. (BIGNUM_NEGATIVE_P): Renamed from RBIGNUM_NEGATIVE_P. (BIGNUM_EMBED_FLAG): Renamed from RBIGNUM_EMBED_FLAG. (BIGNUM_EMBED_LEN_MASK): Renamed from RBIGNUM_EMBED_LEN_MASK. (BIGNUM_EMBED_LEN_SHIFT): Renamed from RBIGNUM_EMBED_LEN_SHIFT. (BIGNUM_LEN): Renamed from RBIGNUM_LEN. (RBIGNUM_DIGITS): Renamed from RBIGNUM_DIGITS. (BIGNUM_LENINT): Renamed from RBIGNUM_LENINT. * bignum.c: Follow the above change. * gc.c: Ditto. * marshal.c: Ditto. * math.c: Ditto. * numeric.c: Ditto. * random.c: Ditto. * rational.c: Ditto. * sprintf.c: Ditto. * ext/-test-/bignum/bigzero.c: Ditto. * ext/-test-/bignum/intpack.c: Ditto. * ext/bigdecimal/bigdecimal.c: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-13* marshal.c: fix typo by @xta [fix GH-533] [ci skip]hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-08marshal.c: Numerics are not taintednobu
* include/ruby/ruby.h (OBJ_TAINTABLE, OBJ_TAINT, OBJ_INFECT), marshal.c (r_entry0): all Numerics never be tainted now. [ruby-core:57346] [Bug #8945] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05pack.c: hide associated objectsnobu
* marshal.c (to_be_skipped_id): ignore anonymous attributes. * pack.c (Init_pack): use anonymous ID so that associated objects do not appear in the packed result. * parse.y (rb_make_internal_id): return an anonymous ID for internal use. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05marshal.c: refine special instance variablesnobu
* marshal.c (w_obj_each, obj_count_ivars): count instance variables accurately. * marshal.c (encoding_name, w_encoding): separate getting encoding values and writing them. * marshal.c (w_symbol, w_ivar, w_objivar, w_object): refine special instance variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05marshal.c: preserve encodingnobu
* marshal.c (must_not_be_anonymous, class2path): preserve encoding in the exception messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-09 * marshal.c: [DOC] Wordsmith marshal.c documentation. by @vipulnsward ↵hsbt
[fix GH-470] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-23* marshal.c (w_object): Use HASH_PROC_DEFAULT directly from internal.htmm1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29* add RUBY_TYPED_FREE_IMMEDIATELY to data types which only useko1
safe functions during garbage collection such as xfree(). On default, T_DATA objects are freed at same points as fianlizers. This approach protects issues such as reported by [ruby-dev:35578]. However, freeing T_DATA objects immediately helps heap usage. Most of T_DATA (in other words, most of dfree functions) are safe. However, we turned off RUBY_TYPED_FREE_IMMEDIATELY by default for safety. * cont.c: ditto. * dir.c: ditto. * encoding.c: ditto. * enumerator.c: ditto. * error.c: ditto. * file.c: ditto. * gc.c: ditto. * io.c: ditto. * iseq.c: ditto. * marshal.c: ditto. * parse.y: ditto. * proc.c: ditto. * process.c: ditto. * random.c: ditto. * thread.c: ditto. * time.c: ditto. * transcode.c: ditto. * variable.c: ditto. * vm.c: ditto. * vm_backtrace.c: ditto. * vm_trace.c: ditto. * ext/bigdecimal/bigdecimal.c: ditto. * ext/objspace/objspace.c: ditto. * ext/stringio/stringio.c: ditto. * ext/strscan/strscan.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-25* bignum.c (MSB): Removed.akr
(BDIGIT_MSB): Defined using BIGRAD_HALF. (bary_2comp): Apply BIGLO after possible over flow of BDIGIT. (get2comp): Ditto. (bary_unpack_internal): Use BDIGIT_MSB. Apply BIGLO after possible over flow of BDIGIT. (rb_integer_unpack): Use BDIGIT_MSB. (calc_hbase): Use BDIGMAX. (big2dbl): Use BDIGMAX. Apply BIGLO after possible over flow of BDIGIT. (rb_big_neg): Apply BIGLO after possible over flow of BDIGIT. (biglsh_bang): Ditto. (bigrsh_bang): Ditto. (bary_divmod): Use BDIGIT_MSB. (bigdivrem): Ditto. (bigxor_int): Apply BIGLO after possible over flow of BDIGIT. * marshal.c (shortlen): Use SIZEOF_BDIGITS instead of sizeof(BDIGIT). * ext/openssl/ossl_bn.c (ossl_bn_initialize): Use SIZEOF_BDIGITS instead of sizeof(BDIGIT). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-21* include/ruby/ruby.h: support write barrier protection for T_STRUCT.ko1
Introduce the following C APIs: * RSTRUCT_RAWPTR(st) returns pointer (do WB on your risk). The type of returned pointer is (const VALUE *). * RSTRUCT_GET(st, idx) returns idx-th value of struct. * RSTRUCT_SET(st, idx, v) set idx-th value by v with WB. And * RSTRUCT_PTR(st) returns pointer with shady operation. The type of returned pointer is (VALUE *). * struct.c, re.c, gc.c, marshal.c: rewrite with above APIs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo
when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-11* internal.h (INTEGER_PACK_NEGATIVE): Defined.akr
(rb_integer_unpack): sign argument removed. * bignum.c (rb_integer_unpack): sign argument removed. Non-negative integers generated by default. INTEGER_PACK_NEGATIVE flag is used to generate non-positive integers. * pack.c (pack_unpack): Follow the above change. * random.c (int_pair_to_real_inclusive): Ditto. (make_seed_value): Ditto. (mt_state): Ditto. (limited_big_rand): Ditto. * marshal.c (r_object0): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-08* marshal.c (r_object0): Use rb_integer_unpack.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04* marshal.c (r_object0): Generalize a round up expression.akr
Use BDIGIT instead of int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-02fill rdocsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-26* hash.c, include/ruby/ruby.h: support WB protected hash.ko1
* constify RHash::ifnone and make new macro RHASH_SET_IFNONE(). * insert write barrier for st_update(). * include/ruby/intern.h: declare rb_hash_set_ifnone(hash, ifnone). * marshal.c (r_object0): use RHASH_SET_IFNONE(). * ext/openssl/ossl_x509name.c (Init_ossl_x509name): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13* gc.c: support RGENGC. [ruby-trunk - Feature #8339]ko1
See this ticet about RGENGC. * gc.c: Add several flags: * RGENGC_DEBUG: if >0, then prints debug information. * RGENGC_CHECK_MODE: if >0, add assertions. * RGENGC_PROFILE: if >0, add profiling features. check GC.stat and GC::Profiler. * include/ruby/ruby.h: disable RGENGC by default (USE_RGENGC == 0). * array.c: add write barriers for T_ARRAY and generate sunny objects. * include/ruby/ruby.h (RARRAY_PTR_USE): added. Use this macro if you want to access raw pointers. If you modify the contents which pointer pointed, then you need to care write barrier. * bignum.c, marshal.c, random.c: generate T_BIGNUM sunny objects. * complex.c, include/ruby/ruby.h: add write barriers for T_COMPLEX and generate sunny objects. * rational.c (nurat_s_new_internal), include/ruby/ruby.h: add write barriers for T_RATIONAL and generate sunny objects. * internal.h: add write barriers for RBasic::klass. * numeric.c (rb_float_new_in_heap): generate sunny T_FLOAT objects. * object.c (rb_class_allocate_instance), range.c: generate sunny T_OBJECT objects. * string.c: add write barriers for T_STRING and generate sunny objects. * variable.c: add write barriers for ivars. * vm_insnhelper.c (vm_setivar): ditto. * include/ruby/ruby.h, debug.c: use two flags FL_WB_PROTECTED and FL_OLDGEN. * node.h (NODE_FL_CREF_PUSHED_BY_EVAL, NODE_FL_CREF_OMOD_SHARED): move flag bits. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13* include/ruby/ruby.h: constify RBasic::klass and addko1
RBASIC_CLASS(obj) macro which returns a class of `obj'. This change is a part of RGENGC branch [ruby-trunk - Feature #8339]. * object.c: add new function rb_obj_reveal(). This function reveal interal (hidden) object by rb_obj_hide(). Note that do not change class before and after hiding. Only permitted example is: klass = RBASIC_CLASS(obj); rb_obj_hide(obj); .... rb_obj_reveal(obj, klass); TODO: API design. rb_obj_reveal() should be replaced with others. TODO: modify constified variables using cast may be harmful for compiler's analysis and optimizaton. Any idea to prohibt inserting RBasic::klass directly? If rename RBasic::klass and force to use RBASIC_CLASS(obj), then all codes such as `RBASIC(obj)->klass' will be compilation error. Is it acceptable? (We have similar experience at Ruby 1.9, for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)". * internal.h: add some macros. * RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal object. * RBASIC_SET_CLASS(obj, cls) set RBasic::klass. * RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS without write barrier (planned). * RCLASS_SET_SUPER(a, b) set super class of a. * array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c, file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c, parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c, string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c: Use above macros and functions to access RBasic::klass. * ext/coverage/coverage.c, ext/readline/readline.c, ext/socket/ancdata.c, ext/socket/init.c, * ext/zlib/zlib.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13* *.c, parse.y, insns.def: use RARRAY_AREF/ASET macroko1
instead of using RARRAY_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-02marshal.c: no overwriting ivarsnobu
* marshal.c (copy_ivar_i): get rid of overwriting already copied instance variales. c.f. [Bug #8276] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-22marshal.c: fix marshal_load ivarnobu
* marshal.c (r_object0): copy all instance variables not only generic ivars, before calling post proc. [ruby-core:51163] [Bug #7627] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-20marshal.c: use ivars of marshal_dump datanobu
* marshal.c (w_object): dump no ivars to the original by marshal_dump. [ruby-core:54334] [Bug #8276] * marshal.c (r_object0): copy all ivars of marshal_dump data to the result object instead. [ruby-core:51163] [Bug #7627] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-19marshal.c: no duplicated encodingnobu
* marshal.c (w_object): do not dump encoding which is dumped with marshal_dump data. [ruby-core:54334] [Bug #8276] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-21* marshal.c (marshal_dump, marshal_load): workaround for segv onngoto
Intel Solaris compiled with Oracle SolarisStudio 12.3. Partly revert r38174. [ruby-core:52042] [Bug #7805] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-09marshal.c: check for prependednobu
* marshal.c (w_extended): check for prepended object. [ruby-core:53206] [Bug #8043] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-08marshal.c: prepended objectsnobu
* marshal.c (r_object0): load prepended objects. treat the class of extended object in the included modules as prepended singleton class. [ruby-core:53202] [Bug #8041] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-01* marshal.c: add security considerations to marshal overview, refer tocharliesome
overview from Marshal.load documentation [#7759] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-01marshal.c: prohibit_ivarnobu
* marshal.c (r_object0): prohibit setting instance variables of exising class/module. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-31marshal.c: warn against using Marshal.load on untrusted datacharliesome
* marshal.c (marshal_load): Add documentation warning against using Marshal.load on untrusted data [Bug #7759] [ruby-core:51765] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-26marshal.c: marshal_dump instance varialbesnobu
* marshal.c (w_object): dump instance varialbes of the result of marshal_dump not the original object. [ruby-core:51163] [Bug #7627] * complex.c (nucomp_marshal_dump): need to copy instance variables. * rational.c (nurat_marshal_dump): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-20marshal.c: get back to the old behaviornobu
* marshal.c (w_object, r_object0): separate respond_to checks and calling, and get back to the old behavior for 2.0. [Bug #7564] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-23marshal.c: rb_check_funcall_with_hooknobu
* vm_eval.c (rb_check_funcall_with_hook): rb_check_funcall with hook which is called before calling method_missing or target method. * marshal.c (w_object, r_object0): use rb_check_funcall_with_hook instead of respond_to? and call. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-23marshal.c: use RB_TYPE_Pnobu
* marshal.c (r_entry0): use RB_TYPE_P. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-19* marshal.c (marshal_dump, marshal_load): fix SEGV during make rdocngoto
and test failure in TestMarshal#test_gc and test_context_switch on SPARC Solaris 10 compiled with Oracle Solaris Studio 12.3. [Bug #7591] [ruby-dev:46772] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-13* marshal.c (r_entry0): don't taint classes and modules becauseshugo
Marshal.load just return the dumped classes and modules. [Bug #7325] [ruby-core:49198] * test/ruby/test_marshal.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-04marshal.c: PRIsVALUEnobu
* marshal.c (path2class, path2module): use PRIsVALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-04marshal.c: rb_check_funcallnobu
* marshal.c (w_object, marshal_dump, marshal_load): use rb_check_funcall if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-04marshal.c: GC guardnobu
* marshal.c (w_object, marshal_dump, r_object0, marshal_load): use RB_GC_GUARD() (directly or indirectly) instead of volatile. * variable.c (rb_path_to_class): prevent the arguemnt from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01marshal.c: private methodsnobu
* marshal.c (w_object, r_object0): call private marshal methods. [Feature #6539] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-20* marshal.c: add marshal readahead. marshalized Array, Hash and Structglass
have size at least number of its elements, marshal readahead will read the certain readable length and buffer when it needs more bytes. marshal readahead prevents many calls to IO#getbyte and IO#read, then it enables performace improvement. [ruby-dev:45637] [Feature #6440] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-16* marshal.c (w_object): add flonum to arg->data to keep reference indexnagachika
consistency. [ruby-core:49323] [Bug #7348] * test/ruby/test_marshal.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-20* include/ruby/ruby.h: add C APIs.nari
VALUE rb_newobj_of(VALUE klass, VALUE flags) #define NEWOBJ_OF(obj,type,klass,flags) These allow to change a allocation strategy depending on klass or flags. * gc.c: ditto * array.c: use new C API. * bignum.c: ditto * class.c: ditto * complex.c: ditto * ext/socket/ancdata.c: ditto * ext/socket/option.c: ditto * hash.c: ditto * io.c: ditto * marshal.c: ditto * numeric.c: ditto * object.c: ditto * random.c: ditto * range.c: ditto * rational.c: ditto * re.c: ditto * string.c: ditto * struct.c: ditto [Feature #7177][Feature #7047] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-23* include/ruby/ruby.h: introduce flonum technique forko1
64bit CPU environment (sizeof(double) == sizeof(VALUE)). flonum technique enables to avoid double object creation if the double value d is in range about between 1.72723e-77 < |d| <= 1.15792e+77 or 0.0. flonum Float value is immediate and their lowest two bits are b10. If flonum is activated, then USE_FLONUM macro is 1. I'll write detailed in this technique on https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/Flonum_tech * benchmark/bmx_temp.rb: add an benchmark for simple Float calculation. * gc.c (id2ref, rb_obj_id): add flonum Float support. * include/ruby/intern.h: move decl of rb_float_new(double) to include/ruby/ruby.h. * insns.def, vm.c, vm_insnhelper.c: add flonum optimization and simplify source code. * vm_insnhelper.h (FLONUM_2_P): added. * marshal.c: support flonum output. * numeric.c (rb_float_new_in_heap): added. * parse.y: support flonum. * random.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22marshal.c: io_needednobu
* marshal.c (io_needed): extract from marshal_dump and marshal_load. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-04compatible loadernobu
* marshal.c (r_object0): also load TYPE_USRMARSHAL, TYPE_DATA using compatible loader. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-03adjust indentnobu
* marshal.c (r_object0): adjust indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-03remove old warningnobu
* marshal.c (r_object0): remove old warning for _alloc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e