aboutsummaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* rb_ivar_foreach now free from ANYARGS卜部昌平2019-08-271-1/+1
| | | | | | | After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit adds a function prototype for rb_ivar_foreach. Luckily this change revealed no problematic usage of the function.
* rb_hash_foreach now free from ANYARGS卜部昌平2019-08-271-2/+2
| | | | | | | After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit adds function prototypes for rb_hash_foreach / st_foreach_safe. Also fixes some prototype mismatches.
* rb_define_hooked_variable now free from ANYARGS卜部昌平2019-08-272-17/+15
| | | | | | | | | After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit uses rb_gvar_getter_t / rb_gvar_setter_t for rb_define_hooked_variable / rb_define_virtual_variable which revealed lots of function prototype inconsistencies. Some of them were literally decades old, going back to dda5dc00cff334cac373096d444a0fd59e716124.
* struct st_hash_type now free from ANYARGS卜部昌平2019-08-271-2/+2
| | | | | | | After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit adds function prototypes for struct st_hash_type. Honestly I don't understand why they were commented out at the first place.
* st_foreach now free from ANYARGS卜部昌平2019-08-271-3/+5
| | | | | | | | After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit deletes ANYARGS from st_foreach. I strongly believe that this commit should have had come with b0af0592fdd9e9d4e4b863fde006d67ccefeac21, which added extra parameter to st_foreach callbacks.
* rb_thread_create now free from ANYARGS卜部昌平2019-08-271-1/+1
| | | | | | After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit deletes ANYARGS from rb_thread_create, which seems very safe to do.
* rb_proc_new / rb_fiber_new now free from ANYARGS卜部昌平2019-08-271-2/+2
| | | | | | | After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit deletes ANYARGS from rb_proc_new / rb_fiber_new, and applies RB_BLOCK_CALL_FUNC_ARGLIST wherever necessary.
* rb_catch now free from ANYARGS卜部昌平2019-08-271-2/+2
| | | | | | After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit deletes ANYARGS from rb_catch, and fixes some bugs revealed by that.
* rb_ensure now free from ANYARGS卜部昌平2019-08-271-1/+1
| | | | | | After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit deletes ANYARGS from rb_ensure, which also revealed many arity / type mismatches.
* rb_rescue / rb_rescue2 now free from ANYARGS卜部昌平2019-08-271-2/+2
| | | | | | After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit deletes ANYARGS from rb_rescue / rb_rescue2, which revealed many arity / type mismatches.
* rb_iterate now takes rb_block_call_func_t卜部昌平2019-08-271-1/+1
| | | | | | After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit makes rb_iterate free from ANYARGS.
* #define RB_BLOCK_CALL_FUNC_STRICT 1卜部昌平2019-08-271-5/+1
| | | | | | After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. Let's start from making rb_block_call_func_t strict, and apply RB_BLOCK_CALL_FUNC_ARGLIST liberally.
* Fix FL_USER19Nobuyoshi Nakada2019-08-191-1/+1
| | | | | * include/ruby/ruby.h: cast via `unsigned int` explicitly, to get rid of signed extension by implicit integer promotion.
* io.c: export rb_io_extract_modeencNobuyoshi Nakada2019-08-141-0/+3
| | | | | | * include/ruby/io.h (rb_io_enc_t): add typedef. * io.c (rb_io_extract_modeenc): export.
* Renamed ruby_finalize_{0,1}Nobuyoshi Nakada2019-08-132-3/+10
| | | | And pass rb_execution_context_t as an argument.
* Rename rb_gc_mark_no_pin -> rb_gc_mark_movableAaron Patterson2019-08-121-1/+1
| | | | | | Renaming this function. "No pin" leaks some implementation details. We just want users to know that if they mark this object, the reference may move and they'll need to update the reference accordingly.
* rb_trap_exec has been removed since 1.9Nobuyoshi Nakada2019-08-121-1/+0
|
* The value of rb_scan_args_verify is never usedNobuyoshi Nakada2019-08-061-5/+5
|
* Distinguish bad scan format from no argument variablesNobuyoshi Nakada2019-08-061-2/+2
|
* Use negative-sized array instead of zero-divisionNobuyoshi Nakada2019-08-051-21/+7
|
* Unused macro argument `varc`Nobuyoshi Nakada2019-08-051-23/+23
|
* Revert "Always evaluate the expression RUBY_ASSERT_MESG_WHEN just once"Nobuyoshi Nakada2019-08-051-1/+1
| | | | | | | It caused a significant benchmark fall. Some assertions seem to use expressions with side-effects which cannot be inlined. This reverts commit b452c03a14f943ae25338547bd680fce67399d85.
* Fix errno at seeking socket/pipe on WindowsNobuyoshi Nakada2019-07-251-1/+2
| | | | [Bug #12230]
* constify again.Koichi Sasada2019-07-221-3/+3
| | | | | | | | | | | | | | | | | | | | Same as last commit, make some fields `const`. include/ruby/ruby.h: * Rasic::klass * RArray::heap::aux::shared_root * RRegexp::src internal.h: * rb_classext_struct::origin_, redefined_class * vm_svar::cref_or_me, lastline, backref, others * vm_throw_data::throw_obj * vm_ifunc::data * MEMO::v1, v2, u3::value While modifying this patch, I found write-barrier miss on rb_classext_struct::redefined_class. Also vm_throw_data::throw_state is only `int` so change the type.
* * expand tabs.git2019-07-191-1/+1
|
* fix shared array terminology.Koichi Sasada2019-07-191-1/+1
| | | | | | | | | | | | | | | | | | Shared arrays created by Array#dup and so on points a shared_root object to manage lifetime of Array buffer. However, sometimes shared_root is called only shared so it is confusing. So I fixed these wording "shared" to "shared_root". * RArray::heap::aux::shared -> RArray::heap::aux::shared_root * ARY_SHARED() -> ARY_SHARED_ROOT() * ARY_SHARED_NUM() -> ARY_SHARED_ROOT_REFCNT() Also, add some debug_counters to count shared array objects. * ary_shared_create: shared ary by Array#dup and so on. * ary_shared: finished in shard. * ary_shared_root_occupied: shared_root but has only 1 refcnt. The number (ary_shared - ary_shared_root_occupied) is meaningful.
* Always evaluate the expression RUBY_ASSERT_MESG_WHEN just onceNobuyoshi Nakada2019-07-151-1/+1
|
* Enable RUBY_ASSERT_MESG_WHEN when RUBY_DEBUG is turned onNobuyoshi Nakada2019-07-151-3/+4
|
* introduce RUBY_ASSERT_ALWAYS(expr).Koichi Sasada2019-07-151-0/+1
| | | | | RUBY_ASSERT_ALWAYS(expr) ignores NDEBUG (we cannot remove this assertion).
* Introduce RUBY_DEBUG flag macroNobuyoshi Nakada2019-07-141-1/+4
| | | | | When RUBY_DEBUG is turned on, all RUBY_ASSERT() macros will be enabled regardless RUBY_NDEBUG.
* Include ruby/assert.h in ruby/ruby.h so that assertions can be thereNobuyoshi Nakada2019-07-141-0/+1
|
* * expand tabs.git2019-07-141-3/+3
|
* Split RUBY_ASSERT and so on under include/rubyNobuyoshi Nakada2019-07-141-0/+49
|
* Remove IA64 support.Samuel Williams2019-06-192-10/+0
|
* Revert "marshal.c: new functions for extensions"Nobuyoshi Nakada2019-06-041-2/+0
| | | | This reverts a commit miss, 24a96a0228ccf355826644a9daad69e11b67b53b.
* marshal.c: new functions for extensionsNobuyoshi Nakada2019-06-041-0/+2
| | | | | | | | * marshal.c (rb_marshal_dump_limited): new function for extension libraries to dump object with limited nest level. * marshal.c (rb_marshal_load_with_proc): new function for extension libraries to load object with hook proc.
* Added missing predicate macrosNobuyoshi Nakada2019-05-281-0/+3
|
* remove obsolete rb_gc_finalize_deferred().Koichi Sasada2019-05-281-1/+0
| | | | | | | rb_gc_finalize_deferred() is remained for compatibility with C-extensions. However, this function is no longer working from Ruby 2.4 (crash with SEGV immediately). So remove it completely.
* Add FrozenError#receiverJeremy Evans2019-05-261-0/+1
| | | | | | | | | | | | | | | | | Similar to NameError#receiver, this returns the object on which the modification was attempted. This is useful as it can pinpoint exactly what is frozen. In many cases when a FrozenError is raised, you cannot determine from the context which object is frozen that you attempted to modify. Users of the current rb_error_frozen C function will have to switch to using rb_error_frozen_object or the new rb_frozen_error_raise in order to set the receiver of the FrozenError. To allow the receiver to be set from Ruby, support an optional second argument to FrozenError#initialize. Implements [Feature #15751]
* Suppress paranoid warnings for external/3rd-party librariesNobuyoshi Nakada2019-05-231-0/+2
| | | | [Feature #15665]
* Eagerly name modules and classesAlan Wu2019-05-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | * variable.c: make the hidden ivars `classpath` and `tmp_classpath` the source of truth for module and constant names. Assign to them when modules are bind to constants. * variable.c: remove references to module name cache, as what used to be the cache is now the source of truth. Remove rb_class_path_no_cache(). * variable.c: remove the hidden ivar `classid`. This existed for the purposes of module name search, which is now replaced. Also, remove the associated rb_name_class(). * class.c: use rb_set_class_path_string to set the name of Object during boot. Must use a fstring as this runs before rb_cString is initialized and creating a normal string leads to a VALUE without a class. * spec/ruby/core/module/name_spec.rb: add a few specs to specify what happens to Module#name across multiple operations. These specs pass without other code changes in this commit. [Feature #15765]
* Rename rb_gc_new_location to rb_gc_locationAaron Patterson2019-05-181-1/+1
| | | | | The function will return new or existing locations depending on whether or not the object actually moved, so give it a more appropriate name.
* Do not call memcpy if copying nothingNobuyoshi Nakada2019-05-171-0/+9
| | | | | | c.f. * e7b18ca6d9b45b7e71694557b9fab8152c62c1ed * 34e1079aef81d108890fb167d7df69960e994ff5
* Reduce ONIG_NREGION from 10 to 4: power of 2 and testing revealed most ↵Lourens Naudé2019-05-071-1/+1
| | | | | | pattern matches are less than or equal to 4 results Closes: https://github.com/ruby/ruby/pull/2135
* Remove member char_offset_updated from struct rmatch as member ↵Lourens Naudé2019-04-241-2/+1
| | | | char_offset_num_allocated can serve the same purpose as that predicate
* Only define history_root member of the Oniguruma re_registers struct if ↵Lourens Naudé2019-04-241-0/+6
| | | | USE_CAPTURE_HISTORY is enabled
* ViewVC of svn.ruby-lang.org was shutdown status.SHIBATA Hiroshi2019-04-221-2/+1
|
* Make rb_hash_bulk_insert publicnaruse2019-04-211-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add `GC.compact` again.tenderlove2019-04-203-4/+17
| | | | | | 🙏 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Reverting compaction for nowtenderlove2019-04-173-17/+4
| | | | | | For some reason symbols (or classes) are being overridden in trunk git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e