summaryrefslogtreecommitdiff
path: root/marshal.c
AgeCommit message (Collapse)Author
2008-09-15* gc.c, include/ruby/ruby.h: rename rb_register_mark_object()ko1
to rb_gc_register_mark_object(). * eval.c, vm.c: initialize vm->mark_object_ary at Init_top_self(). * bignum.c, complex.c, encoding.c, ext/win32ole/win32ole.c, io.c, load.c, marshal.c, rational.c, ruby.c, vm.c: use rb_gc_register_mark_object() instead of rb_global_variable() or rb_gc_register_address(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-05* include/ruby/ruby.h (DBL2NUM): renamed from DOUBLE2NUM.matz
a patch from Tadashi Saito <shiba at mail2.accsnet.ne.jp> in [ruby-dev:36102]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-02* marshal.c (struct load_arg): data is now st_table.nobu
* marshal.c (mark_load_arg): marks data and compat_tbl. * marshal.c (r_object0): no need to check if reentered. * marshal.c (marshal_load): make the wrapper with mark_load_arg. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-16* include/ruby/ruby.h (rb_intern_const): tiny optimization.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13* marshal.c (marshal_load): set arg.untrust properly.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13* object.c (rb_obj_untrusted): new method Object#untrusted?.shugo
(rb_obj_untrust): new method Object#untrust. (rb_obj_trust): new method Object#trust. * array.c, debug.c, time.c, include/ruby/ruby.h, re.c, variable.c, string.c, io.c, dir.c, vm_method.c, struct.c, class.c, hash.c, ruby.c, marshal.c: fixes for Object#untrusted?. * test/ruby/test_module.rb, test/ruby/test_array.rb, test/ruby/test_object.rb, test/ruby/test_string.rb, test/ruby/test_marshal.rb, test/ruby/test_hash.rb: added tests for Object#untrusted?. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-04* marshal.c (dump_ensure), process.c (run_exec_dup2),nobu
string.c (rb_str_replace), transcode.c (transcode_dispatch): fixed memory leaks. based on patches from shinichiro.h <shinichiro.hamaji AT gmail.com> at [ruby-dev:35751]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-12* configure.in (sizeof ptrdiff_t): check for size of ptrdiff_t.nobu
* include/ruby/ruby.h (PRI?PTRDIFF, PRI?SIZE): printf conversion specifiers for ptrdiff_t and size_t/ssize_t. * insns.def (leave), marshal.c (long_toobig), transcode.c (str_transcode), vm_dump.c (control_frame_dump, stack_dump_each), (debug_print_register, debug_print_pre): t and z length modifiers are C99. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-28* include/ruby/ruby.h (struct RRegexp): new field usecnt. replaceakr
str and len by src. * gc.c (gc_mark_children): mark src field of regexp. (obj_free): don't free str field. * re.c (REG_BUSY): removed. (rb_reg_initialize): prohibit re-initialize regexp. (rb_reg_search): use usecnt to prevent freeing regexp currently using. this prevents SEGV by: r = /\A((a.)*(a.)*)*b/ r =~ "ab" + "\xc2\xa1".force_encoding("euc-jp") t = Thread.new { r =~ "ab"*8 + "\xc2\xa1".force_encoding("utf-8")} sleep 0.2 r =~ "ab"*8 + "\xc2\xa1".force_encoding("euc-jp") git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-18* marshal.c (w_object, marshal_dump, r_object0, marshal_load): searchnobu
public methods only. [ruby-core:17283] * object.c (convert_type): ditto. * lib/singleton.rb (Singleton#_dump): conversion method should be public. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09* include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu
* *.c: no cache in init functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-02* marshal.c (w_object): add a check for modification of array duringmame
its dump. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-01* rational.c (string_to_r_internal): use rb_isdigit.naruse
* marshal.c (long_toobig): use %zd. * ruby.c (set_arg0): move unused variable definition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31* suppress warnings with -Wwrite-string.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-28* marshal.c (w_object, marshal_dump, r_object0, marshal_load): searchnobu
private methods too. [ruby-dev:34671] * object.c (convert_type): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22* marshal.c (check_dump_arg, check_load_arg): check if reentered.nobu
[ruby-dev:34802] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-10* marshal.c (w_object): add volatile to avoid potential GC bug. amatz
patch from Tomoyuki Chikanaga <chikanag at nippon-control-system.co.jp> in [ruby-dev:34311]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-10* marshal.c (w_object): TYPE_USERDEF assigns id for ivars first.akr
[ruby-dev:34159] by nagachika. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-09fix doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-25* include/ruby/ruby.h (ROBJECT_NUMIV): renamed from ROBJECT_LEN.akr
(ROBJECT_IVPTR): renamed from ROBJECT_PTR. * variable.c: follow the above renaming. * object.c: ditto. * gc.c: ditto. * marshal.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-31 * marshal.c (r_object0): no need to call r_entry for immediate values.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-31* marshal.c (r_object0): call r_entry/r_leave to call proc when TYPE_FIXNUM,naruse
TYPE_NIL, TYPE_TRUE, TYPE_FALSE, TYPE_SYMBOL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-26* marshal.c (w_object): dump string encoding in USERDEF.akr
[ruby-dev:33401] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-25* marshal.c (r_byte): use getbyte instead of getc.akr
(marshal_load): ditto. [ruby-dev:33264] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-07* encoding.c (rb_enc_internal_get_index): extracted fromakr
rb_enc_get_index. (rb_enc_internal_set_index): extracted from rb_enc_associate_index * include/ruby/encoding.h (ENCODING_SET): work over ENCODING_INLINE_MAX. (ENCODING_GET): ditto. (ENCODING_IS_ASCII8BIT): defined. (ENCODING_CODERANGE_SET): defined. * re.c (rb_reg_fixed_encoding_p): use ENCODING_IS_ASCII8BIT. * string.c (rb_enc_str_buf_cat): use ENCODING_IS_ASCII8BIT. * parse.y (reg_fragment_setenc_gen): use ENCODING_IS_ASCII8BIT. * marshal.c (has_ivars): use ENCODING_IS_ASCII8BIT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06* $Date$ keyword removed to avoid inclusion of locale dependentakr
string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-04* include/ruby/intern.h, re.c (rb_reg_new): keep interface same asnobu
1.8. [ruby-core:14583] * include/ruby/intern.h, re.c (rb_reg_new_str): renamed, and defines HAVE_RB_REG_NEW_STR macro to tell if it is available. * include/ruby/encoding.h (rb_enc_reg_new): added. * insns.def (toregexp), marshal.c (r_object0): use rb_reg_new_str(). * re.c (rb_reg_regcomp, rb_reg_s_union): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-22* insnhelper.ci (vm_search_normal_superclass): rename function.matz
* insnhelper.ci (vm_search_superclass): ditto. * proc.c (struct METHOD): rename rklass -> rclass. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-19* configure.in: check struct timespec, clock_gettime, utimensat,akr
struct stat.st_atim, struct stat.st_atimespec, struct stat.st_atimensec, struct stat.st_mtim, struct stat.st_mtimespec, struct stat.st_mtimensec, struct stat.st_ctim, struct stat.st_ctimespec, struct stat.st_ctimensec. * include/ruby/missing.h: provide struct timespec if not available. * time.c: support nanosecond-resolution using struct timespec. * include/ruby/intern.h: provide rb_time_nano_new. * file.c (utime_internal): use utimensat if available. (rb_file_s_utime): refactored. (rb_f_test): use stat_atime, stat_mtime, stat_ctime. (rb_stat_cmp): check tv_nsec. (stat_atimespec): new function. (stat_atime): ditto. (stat_mtimespec): ditto. (stat_mtime): ditto. (stat_ctimespec): ditto. (stat_ctime): ditto. (rb_stat_atime): use stat_atime. (rb_file_s_atime): ditto. (rb_file_atime): ditto. (rb_stat_mtime): use stat_mtime. (rb_file_s_mtime): ditto. (rb_file_mtime): ditto. (rb_file_ctime): use stat_ctime. (rb_file_s_ctime): ditto. (rb_stat_ctime): ditto. * variable.c (rb_copy_generic_ivar): clear clone's instance variables if obj has no instance variable. * marshal.c (w_object): dump instance variables of generated string for TYPE_USERDEF, even if original object has instance variables. * lib/time.rb (Time#xmlschema): use nsec instead of usec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-18* marshal.c (mark_dump_arg): it may be called after dump_ensure.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-13* include/ruby/ruby.h: introduce 2 macros:ko1
RFLOAT_VALUE(v), DOUBLE2NUM(dbl). Rename RFloat#value -> RFloat#double_value. Do not touch RFloat#double_value directly. * bignum.c, insns.def, marshal.c, math.c, numeric.c, object.c, pack.c, parse.y, process.c, random.c, sprintf.c, string.c, time.c: apply above changes. * ext/dl/mkcallback.rb, ext/json/ext/generator/generator.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-09* test/ruby/test_basicinstructions.rb: updated for new classmatz
behavior. [ruby-dev:32192] * encoding.c (enc_name): Encoding should not rely on ENCODING in the FL_USERS flags. * encoding.c (rb_enc_from_encoding): do not call rb_enc_associate for encoding itself. * encoding.c (enc_register_at): ditto. * marshal.c (r_ivar): do not set real instance variable for encoding data associated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-09* marshal.c (w_object): should be SPECIAL_CONST_P() instead ofko1
IMMEDIATE_P(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-19* encoding.c (rb_id_encoding): returns ID "encoding".nobu
* marshal.c (w_encoding): dump encoding name. * marshal.c (r_ivar): load encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-15* marshal.c (r_bytes0): refined length check. [ruby-dev:32059]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-15* marshal.c (r_bytes0): commit miss.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-15* marshal.c (r_bytes0): check if source has enough data.nobu
[ruby-dev:32054] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-29* marshal.c (r_leave): move proc invocation from r_entry() tomatz
avoid potential crash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-28* include/ruby/intern.h: export rb_ivar_foreach.akr
* include/ruby/ruby.h: modify struct RObject and RClass for optimizing T_OBJECT space. [ruby-dev:31853] (ROBJECT_LEN, ROBJECT_PTR) (RCLASS_IV_TBL, RCLASS_M_TBL, RCLASS_SUPER, RCLASS_IV_INDEX_TBL) (RMODULE_IV_TBL, RMODULE_M_TBL, RMODULE_SUPER): abstract accessor defined. * variable.c: support the modified RObject and RClass. * object.c: ditto. * class.c: ditto. * gc.c: ditto. * marshal.c: ditto. * eval_method.ci: use the abstract accessor. * insns.def: ditto. * proc.c: ditto. * struct.c: ditto. * eval.c: ditto. * error.c: ditto. * vm.c: ditto. * insnhelper.ci: ditto. * ext/digest/digest.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-26* gc.c (rb_mark_set): new function to mark keys.nobu
* marshal.c (struct dump_arg, struct load_arg): added wrappers to mark data and compat_tbl entries. [ruby-dev:31870] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-26* marshal.c (struct dump_arg, struct load_arg): added wrappers to marknobu
compat_tbl entries. [ruby-dev:31870] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-12* io.c (rb_io_s_sysopen): should not use alloca for unknowen sizenobu
input. [ruby-dev:31775] * parse.y (rb_id2str): ditto. * marshal.c (w_float): use snprintf instead of sprintf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-09* marshal.c (r_object0): struct allocation first to check if amatz
class is a struct. compatibility check should come next. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-08* marshal.c (r_object0): check T_STRUCT type for structs.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-08values doesn't needs to be volatile since it is passed to rb_struct_initialize.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-08* marshal.c (r_object0): don't call user-defined initialize forakr
T_STRUCT objects. * include/ruby/intern.h (rb_struct_initialize): declared. * struct.c (rb_struct_initialize): export. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-08abolish warnings.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-08* eval_method.ci (rb_get_alloc_func): new function to get allocationakr
function. * include/ruby/intern.h (rb_alloc_func_t): declared. (rb_define_alloc_func): declared. (rb_marshal_define_compat): declared. * range.c: use T_STRUCT for Range. * inits.c: move Init_marshal() prior to Init_Range() because Init_Range calls rb_marshal_define_compat which needs marshal's compat_allocator_tbl initialized. * marshal.c: support marshal format compatibility layer designed for marshaling T_STRUCT Range using T_OBJECT format. (rb_marshal_define_compat): defined. [ruby-dev:31710] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-07* struct.c (rb_struct_s_members): should raise TypeError insteadmatz
of call rb_bug(). [ruby-dev:31709] * marshal.c (r_object0): no nil check require any more. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-01* include/ruby/ruby.h (struct RBignum): embed digits in RBignum forakr
small bignums. * bignum.c: RBignum embeded digits implemented. * include/ruby/intern.h: declare rb_big_resize. * gc.c: don't free embedded digits. * numeric.c: replace direct bignum field accessor by abstract field accessor such as RBIGNUM(val)->sign to RBIGNUM_SIGN(val). * sprintf.c: ditto. * compar.c: ditto. * marshal.c: ditto. * random.c: ditto. * .gdbinit: support embedded small bignums. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e