aboutsummaryrefslogtreecommitdiffstats
path: root/object.c
Commit message (Collapse)AuthorAgeFilesLines
* * object.c (rb_obj_eql): Improve equality documentation by adding andrbrain2012-02-231-15/+22
| | | | | | | | example of equal? vs == and recommending eql? be aliased to == when overridden. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_hash): Added note that the hash value is notdrbrain2012-02-231-8/+11
| | | | | | | | deterministic on Marc-Andre's suggestion. Expanded description of the purpose of the hash method. [Bug #6068] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_Hash): fix mixed declaration and code.nobu2012-01-241-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_Hash): trivial optimization.nobu2012-01-241-1/+1
| | | | | | | * test/ruby/test_object.rb (TestObject#test_convert_hash): fix arguments order. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_Hash): add Kernel#Hash conversion method likematz2012-01-241-0/+34
| | | | | | Array() or Float(). a patch from Run Paint Run Run. Fix #3131 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_inspect): raise the result is not compatible withnaruse2012-01-151-3/+16
| | | | | | | | | | the default external encoding. [ruby-core:42095] [Bug #5848] If the default external encoding is ASCII compatible, the encoding of inspected result must be compatible with it. If the default external encoding is ASCII incomapatible, the result must be ASCII only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c: Added examples for Object#is_a? and Object#instance_of?ayumin2012-01-111-4/+15
| | | | | | patcheed from Manoj Kumar. [Bug #5880] [ruby-core:42057] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix typo of rdoc of Object#inspect.naruse2012-01-071-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: use Bitmap Marking algorithm to avoid copy-on-write ofnari2012-01-071-1/+1
| | | | | | | | | | | | | | | | | 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
* * object.c (rb_inspect): raises Encoding::CompatibilityError if thenaruse2012-01-061-6/+32
| | | | | | | result is incompatible with the default external encoding. [ruby-core:41931] [Bug #5848] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_check_to_int): new function to convert a VALUE tonobu2011-12-111-0/+6
| | | | | | | | an Integer if possible, but returns nil instead of raising an exception otherwise. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (Init_Object): Add reference to BasicObject, briefdrbrain2011-10-101-7/+18
| | | | | | | | | explanation of constant lookup. Based on patch by Alvaro Pereyra Rabanal. [Ruby 1.9 - Bug #5426] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * use RB_TYPE_P which is optimized for constant types, instead ofnobu2011-09-291-6/+6
| | | | | | comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_clone): singleton class should be attachednobu2011-09-181-1/+6
| | | | | | | singleton object to. a patch by Satoshi Shiba <shiba AT rvm.jp> at [ruby-dev:44460]. [Bug #5274] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c: Add usage documentation for BasicObject. Based on patchdrbrain2011-07-271-0/+47
| | | | | | | by Thomas Sawyer. [Ruby 1.9 - Bug #5067] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c (rb_print_undef_str): new function to raisenobu2011-07-261-1/+19
| | | | | | | | | | | NameError for undefined method. * load.c (rb_mod_autoload_p), object.c (rb_mod_const_get), variable.c (rb_f_untrace_var, set_const_visibility), vm_method.c (rb_mod_{remove,undef,alias}_method, set_method_visibility): remove inadvertent symbol creation. based on the first patch by Jeremy Evans at [ruby-core:38447]. [Feature #5089] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (rb_check_id): make the given name a symbol or a string.nobu2011-07-261-5/+5
| | | | | | based on the second patch by Jeremy Evans at [ruby-core:38447] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_name_error_str): new function to raise NameErrornobu2011-07-231-6/+43
| | | | | | | | with the name string but not ID. * object.c, proc.c, variable.c: more removal of inadvertent symbol creation. [Feature #5079] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_mod_{const,cvar}_defined, rb_obj_ivar_defined):nobu2011-07-221-3/+6
| | | | | | | | | | | | avoid inadvertent symbol creation in reflection methods. based on a patch by Jeremy Evans at [ruby-core:38367]. [Feature #5072] * vm_method.c (rb_mod_method_defined) (rb_mod_{public,private,protected}_method_defined) (obj_respond_to): ditto. * parse.y (rb_check_id): new function returns already interned ID or 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * math.c: Attach documentation for Math.drbrain2011-06-291-0/+9
| | | | | | | | | | | | | | | | | | | | * object.c: Document NIL, TRUE, FALSE. * io.c: Improve grammar in ARGF comment. Document STDIN/OUT/ERR. Document ARGF global constant. * lib/rake: Hide deprecated toplevel constants from RDoc (import from rake trunk). * lib/thwait.rb: Document ThWait. * lib/mathn.rb: Hide Math redefinition from RDoc * lib/sync.rb: Add a basic comment for Sync_m, Synchronizer_m, Sync, Synchronizer. * parse.y: Document SCRIPT_LINES__. * hash.c: Document ENV class and global constant. * vm.c: Document TOPLEVEL_BINDING. * version.c: Document RUBY_* constants. * ruby.c: Document DATA and ARGV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (Init_Object): Teach RDoc what Init_class_hierarchy does todrbrain2011-06-271-13/+22
| | | | | | | hook up ri for BasicObject, Object, Module and Class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h, internal.h iseq.h: declare internal functions.akr2011-06-181-5/+0
| | | | | | | | | | | | | | | | | | * compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c, thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't declare internal functions. Note that rb_method_entry_eq() is defined in vm_method.c but there was a declaration in proc.c with different const-ness. Now it is declared in method.h with same const-ness to the definition. * object.c (rb_mod_module_exec): don't declare functions declared in include/ruby/intern.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/backward/classext.h: for evil gems. fixed #4803nobu2011-06-181-0/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: declare internal functions here.akr2011-06-171-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | * 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
* * object.c: Document Module#method_added and #method_removed.drbrain2011-06-171-0/+48
| | | | | | | Patch by Bryce Kerley. [Ruby 1.9 - Feature #4867] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_mod_attr_accessor, rb_mod_const_set): made rdocmarcandre2011-05-271-8/+13
| | | | | | more precise by specifying Object can searched for Modules. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: add for internal use only.nobu2011-05-181-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c: format comments to keep 80 columns in a line.nagachika2011-05-121-6/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_equal): Add documentation. Patch by Vincent Batts.drbrain2011-05-111-4/+13
| | | | | | | | | | [Ruby 1.9 - Bug #4664] * lib/rexml: ditto * lib/mkmf.rb: ditto * ext/socket/lib/socket.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_String): Kernel#String should call to_str before to_s.nagachika2011-03-291-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_str_to_dbl): rewrite again. use ALLOCV insteadkosaki2011-01-271-7/+4
| | | | | | | | rb_str_tmp_new(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_str_to_dbl): Fix again. use rb_str_tmp_new()kosaki2011-01-241-4/+7
| | | | | | | | instead ALLOC_N. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_str_to_dbl): use ALLOC_N instead ALLOCA_N becausekosaki2011-01-241-3/+7
| | | | | | | | ALLOC_N may cause stack overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c: Make BasicObject.new accept no parameter.marcandre2010-10-301-3/+3
| | | | | | Revert of r26135 [ruby-core:27080], as per [ruby-core:32952]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (Init_Object), constant.h, variable.cmame2010-10-261-0/+2
| | | | | | | | | | (rb_mod_private_constant, rb_mod_public_constant, set_const_visibility, rb_const_get_0): add Module#public_constant and private_constant. [ruby-dev:39685][ruby-core:32698] * test/ruby/test_module.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c, constant.h, gc.c, method.h, object.c, variable.c,mame2010-10-261-1/+2
| | | | | | | | | | | | 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
* * class.c, gc.c, object.c, variable.c, vm_insnhelper.c,mame2010-10-261-0/+4
| | | | | | | | | | 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
* * array.c, gc.c, hash.c, object.c, string.c, struct.c,nobu2010-10-241-12/+4
| | | | | | | | transcode.c, variable.c, vm.c, vm_insnhelper.c, vm_method.c: replace calls to rb_error_frozen() with rb_check_frozen(). a patch from Run Paint Run Run at [ruby-core:32014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Commit miss.nobu2010-10-191-4/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_sprintf.rb: fix ML ref. [ruby-core:32848]nobu2010-10-191-12/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Improved doco for both Module.new and Class.newryan2010-09-181-3/+26
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_class): remove mention of obsolete method.usa2010-08-271-3/+1
| | | | | | | a patch from Run Paint Run Run at [ruby-core:31842]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add rdoc about Kernel#<=> [ruby-core:31770]naruse2010-08-201-1/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_f_integer): add example with base.nobu2010-07-061-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c: Object#public_methods, private_methods, etc. returnsmame2010-06-171-103/+4
| | | | | | | | | | | | 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
* * removed trailing spaces.nobu2010-05-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c : use simple lazy sweep algorithm for response performancenari2010-05-281-1/+1
| | | | | | | | | | | | | | 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
* * ext/openssl/lib/openssl/x509-internal.rb, lib/forwardable.rb,nobu2010-05-231-1/+1
| | | | | | | | | lib/irb/cmd/fork.rb, lib/mutex_m.rb, lib/shell/process-controller.rb, lib/sync.rb, object.c: suppress warnings patched by Benoit Daloze at [ruby-core:30366]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Documentation: change => in call-seq to ->.marcandre2010-05-171-75/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* * object.c (rb_cstr_to_dbl): return 0.0 if hexadecimal andnaruse2010-04-011-0/+10
| | | | | | | | | baccheck is FALSE: Float("0x1p+0") works, but "0x1p+0".to_f doesn't. [ruby-dev:40650] * util.c (ruby_strtod): allow hexdecimal integers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e