summaryrefslogtreecommitdiff
path: root/class.c
AgeCommit message (Collapse)Author
2012-05-22* class.c (rb_mod_init_copy): Clear the cached inspect string of adrbrain
dup'd anonymous module or class. [ruby-trunk - Bug #6454] * test/ruby/test_module.rb (class TestModule): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-15* reduce UNREACHABLE.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-13* encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "controldrbrain
reaches end of non-void function" warnings. [ruby-trunk - Bug #6066] * re.c (name_to_backref_number): ditto. * object.c (rb_Float): ditto. * io.c (io_readpartial): ditto. * io.c (io_read_nonblock): ditto. * pack.c (rb_uv_to_utf8): ditto. * proc.c (rb_method_entry_arity): ditto. * vm_method.c (rb_f_notimplement): ditto. * struct.c (rb_struct_aset_id): ditto. * class.c (rb_scan_args): ditto. * process.c (rlimit_resource_type): ditto. * process.c (rlimit_resource_value): ditto. * process.c (p_uid_switch): ditto. * process.c (p_gid_switch): ditto. * ext/digest/digest.c (rb_digest_instance_update): ditto. * ext/digest/digest.c (rb_digest_instance_finish): ditto. * ext/digest/digest.c (rb_digest_instance_reset): ditto. * ext/digest/digest.c (rb_digest_instance_block_length): ditto. * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): ditto. * ext/dl/handle.c (rb_dlhandle_close): ditto. * ext/tk/tcltklib.c (pending_exception_check0): ditto. * ext/tk/tcltklib.c (pending_exception_check1): ditto. * ext/tk/tcltklib.c (ip_cancel_eval_core): ditto. * ext/tk/tcltklib.c (lib_get_reltype_name): ditto. * ext/tk/tcltklib.c (create_dummy_encoding_for_tk_core): ditto. * ext/tk/tkutil/tkutil.c (tk_hash_kv): ditto. * ext/openssl/ossl_ssl.c (ossl_ssl_session_reused): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_dsa_verify_asn1): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_at_infinit): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_on_curve): ditto. * ext/fiddle/conversions.c (generic_to_value): ditto. * ext/socket/raddrinfo.c (rsock_io_socket_addrinfo): ditto. * ext/socket/socket.c (sock_s_getnameinfo): ditto. * ext/ripper/eventids2.c (ripper_token2eventid): ditto. * cont.c (return_fiber): ditto. * dmydln.c (dln_load): ditto. * vm_insnhelper.c (vm_search_normal_superclass): ditto. * bignum.c (big_fdiv): ditto. * marshal.c (r_symlink): ditto. * marshal.c (r_symbol): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14* include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]marcandre
* array.c: Use rb_check_arity / rb_error_arity * class.c: ditto * enumerator.c: ditto * eval.c: ditto * file.c: ditto * hash.c: ditto * numeric.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * re.c: ditto * signal.c: ditto * string.c: ditto * struct.c: ditto * transcode.c: ditto * vm_eval.c: ditto * vm_insnhelper.c: ditto & implementation of rb_error_arity * test/ruby/test_arity.rb: tests for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-07* gc.c: use Bitmap Marking algorithm to avoid copy-on-write ofnari
memory pages. See [ruby-dev:45085] [Feature #5839] [ruby-core:41916]. * include/ruby/ruby.h : FL_MARK rename to FL_RESERVED1. * node.h : ditto. * debug.c : ditto. * object.c (rb_obj_clone): FL_MARK move to a bitmap. * class.c (rb_singleton_class_clone): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-05* class.c (rb_obj_methods), compile.c (iseq_compile_each),nobu
iseq.c(iseq_load, rb_iseq_parameters), pack.c (pack_pack), regcomp.c (is_not_included, update_string_node_case_fold), transcode.c (rb_econv_open0, make_replacement), vm_eval.c (raise_method_missing): remove unused variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-04* lib/delegate.rb (Delegator#methods): Kernel#methods receivesnaruse
zero or one argument. [ruby-core:37118] [Bug #4882] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04* class.c (class_alloc): allocate extra memory after containingnobu
object setup to get rid of rare-but-potential memory leak. * gc.c (gc_mark_children): skip marking extended members if ptr is NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04Revert r33397 because it cause segv.naruse
"* class.c (class_alloc): allocate extra memory after containing" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04* class.c (class_alloc): allocate extra memory after containingnobu
object setup to get rid of rare-but-potential memory leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29* use RB_TYPE_P which is optimized for constant types, instead ofnobu
comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-30* class.c (Init_class_hierarchy): should name BasicObjectmatz
explicitly. * variable.c (rb_const_defined_0): should not check for superclasses as const_get. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17* internal.h: declare internal functions here.akr
* node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-04clone_const_inobu
* class.c (clone_const_i, class_instance_method_list): get rid of type-punning function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-04* class.c (check_mix_method_i, do_mix_method_i): not mix methodsnobu
renamed as nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-31* class.c (rb_mix_module): implement Module#mix.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-18* internal.h: add for internal use only.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07cancel subversion backfire. sorrymatz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07* gc.c (rb_gc_set_params): allow GC parameter configuration bymatz
environment variables. based on a patch from funny-falcon at https://gist.github.com/856296, but honors safe level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-05* class.c: fix camelCase to snake_case in documentation code examples.naruse
patched by Andrew Grimm. fixes Bug #4469 * marshal.c: ditto. * proc.c: ditto. * sample/biorhythm.rb: ditto. * vm_eval.c: ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-26 * class.c (clone_method): add GC guard to prevent intermediatenagachika
variable from GC. [Bug #4321] [ruby-dev:43107] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-05* class.c (make_metaclass): fix probable typo. builtin type flagnobu
cannot be used with FL_TEST. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-04* class.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-27* class.c (clone_const): need to return value. fix r29602.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-26* class.c, constant.h, gc.c, method.h, object.c, variable.c,mame
vm_insnhelper.c: use struct rb_constant_entry_t as entry of RCLASS_CONST_TBL. RCLASS_CONST_TBL has contained VALUE of constant directly. Now instead rb_const_entry_t is contained in RCLASS_CONST_TBL, rb_const_entry_t is managed by malloc, and have not only the value itself but also visibility flag. This is another preparation for private constant (see [ruby-dev:39685][ruby-core:32698]). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-26* class.c, gc.c, object.c, variable.c, vm_insnhelper.c,mame
include/ruby/ruby.h: separate RCLASS_CONST_TBL from RCLASS_IV_TBL. RCLASS_IV_TBL has contained not only instance variable table but also constant table. Now the two table are separated to RCLASS_CONST_TBL and RCLASS_IV_TBL. This is a preparation for private constant (see [ruby-dev:39685][ruby-core:32698]). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-17* class.c (rb_define_{class,module}_id_under): register to benobu
marked, which probably are defined and used internally. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-13* array.c (rb_ary_and, rb_ary_or), class.c (rb_mod_init_copy),nobu
gc.c (undefine_final), time.c (time_mload): get rid of type-punning casts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* configure.in (RUBY_CHECK_PRINTF_PREFIX): check for printf formatnobu
specifier if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-10* class.c (rb_scan_args): Add support for optional keywordknu
argument hash. * README.EXT, README.EXT.ja: Update documentation accordingly. * dir.c (dir_initialize): Make use of the new rb_scan_args() feature. * io.c (rb_io_s_popen, rb_scan_open_args, rb_io_initialize) (rb_io_s_pipe, open_key_args, io_s_foreach, io_s_readlines) (rb_io_s_read, rb_io_set_encoding): Ditto. * transcode.c (str_transcode, econv_args) (econv_primitive_convert): Ditto. * ext/zlib/zlib.c (rb_gzreader_initialize): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-01* class.c (rb_include_module): don't clear the method cache if theakr
included module has no method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-27* class.c, compile.c, dir.c, file.c, iseq.c, parse.y, random.c:naruse
clean unused-value warnings. * cont.c, process.c, vm_exec.h: clean cast warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-27* class.c (rb_mod_init_copy): when class is dup'ed, a metaclass of themame
class should be attached to the dup'ed class, not the original class. [ruby-core:30843] [Bug #3461] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-22* class.c: rdoc fix [ruby-core:30449]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-17* object.c: Object#public_methods, private_methods, etc. returnsmame
method ids that belong to the class or the singleton class(es) of the object. [ruby-dev:41613] * class.c: on the other hand, Module#public_instance_methods, etc. returns method ids that belong to the module itself (even if the module is singleton, it does not return method ids of super class(es); see [ruby-core:28837]). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29* removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-28* gc.c : use simple lazy sweep algorithm for response performancenari
gain. See [ruby-dev:41067]. * object.c: FL_MARK of some objects by lazy sweep is copied when RVALUE is cloned. These objects are not marked in the mark phase. So delete FL_MARK. * class.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17* array.c: Documentation: change => in call-seq to ->.marcandre
Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-04* method.h, vm_method.c: rename some internal functions related toko1
rb_method_entry_t. rb_add_method_me() -> rb_method_entry_set(). rb_get_method_entry() -> rb_method_entry_without_cache(). rb_gc_mark_method_entry() -> rb_mark_method_entry(). * class.c, proc.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-29instance_methods should not special-case singleton classes, fixes #2993shyouhei
Signed-off-by: URABE, Shyouhei <shyouhei@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-06* class.c (rb_class_init_copy): raise a TypeError if the argument isshugo
BasicObject. [ruby-core:27060] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-13* object.c (rb_class_initialize): Make sure BasicObject doesn't get ↵marcandre
initialized twice [ruby-core:27577] * class.c (rb_class_init_copy): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-09* class.c (rb_define_class): raise TypeError same as classnobu
statement. [ruby-core:27504] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-14* class.c (rb_mod_init_copy): fix memory leak of Class#dup.mame
[ruby-dev:39687] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-03fix typos.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-23* class.c (rb_class_new): move class check to rb_check_inheritable().matz
* class.c (rb_check_inheritable): should not allow subclass of class Class. [ruby-core:26225] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-22* class.c (rb_obj_basic_to_s_p): typo. Please become familiar withusa
the ANSI style. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-21* object.c (rb_obj_inspect): print instance variables only whenmatz
Object#to_s is not overridden. [ruby-core:24425] * class.c (rb_obj_basic_to_s_p): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-31* class.c (make_singleton_class): variable name changed.yugui
removed an unnecessary conditional. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-31* class.c: refactored singleton class related matters.yugui
Handles eigenclasses and plain classes transparently. (make_metaclass): renamed from make_metametaclass. (METACLASS_OF): new utility macro (META_CLASS_OF_CLASS_CLASS): ditto. (ENSURE_EIGENCLASS): ditto. (make_singleton_class): extracted from rb_singleton_class. (boot_defclass): moved from object.c (Init_class_hierarchy): extracted from Init_Object. (rb_make_metaclass): refactored. (singleton_class_of): extracted from rb_singleton_class. (rb_singleton_class): refactored. (rb_define_singleton_method): it needs a metaclass only but not its metametaclass. * object.c: booting class hierarchy was moved to class.c for keeping dependency between compilation units least. (Init_Object): extracting the booting into Init_class_hierarchy. (boot_defclass): moved to class.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e