aboutsummaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Introduce pattern matching [EXPERIMENTAL]ktsj2019-04-171-0/+1
| | | | | | [ruby-core:87945] [Feature #14912] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Adding `GC.compact` and compacting GC support.tenderlove2019-04-173-4/+17
| | | | | | | | | | | This commit adds the new method `GC.compact` and compacting GC support. Please see this issue for caveats: https://bugs.ruby-lang.org/issues/15626 [Feature #15626] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * expand tabs.svn2019-04-101-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Reverting all commits from r67479 to r67496 because of CI failureskazu2019-04-103-14/+4
| | | | | | | | Because hard to specify commits related to r67479 only. So please commit again. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix RMoved definition locationtenderlove2019-04-091-5/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Adding `GC.compact` and compacting GC support.tenderlove2019-04-093-4/+19
| | | | | | | | | | | This commit adds the new method `GC.compact` and compacting GC support. Please see this issue for caveats: https://bugs.ruby-lang.org/issues/15626 [Feature #15626] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Introduce RVALUE_EMBED_LEN_MAX to remove a magic numbermrkn2019-02-141-3/+8
| | | | | | | | | * include/ruby/ruby.h: replace a magic number with RVALUE_EMBED_LEN_MAX, which indicates the number of VALUE elements can be embedded in a RVALUE. * internal.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* introduce rb_nogvl C-API to mark ubf as async-signal-safenormal2019-01-041-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | zlib and bignum both contain unblocking functions which are async-signal-safe and do not require spawning additional threads. We can execute those functions directly in signal handlers without incurring overhead of extra threads, so provide C-API users the ability to deal with that. Other C-API users may have similar need. This flexible API can supercede existing uses of rb_thread_call_without_gvl and rb_thread_call_without_gvl2 by introducing a flags argument to control behavior. Note: this API is NOT finalized. It needs approval from other committers. I prefer shorter name than previous rb_thread_call_without_gvl* functions because my eyes requires big fonts. [Bug #15499] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* version.h (RUBY_VERSION): 2.7.0 development has started.matz2018-12-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove "deprecated" for rb_frame_method_id_and_class [Bug #15300]ko12018-12-242-3/+1
| | | | | | | | | | | | * include/ruby/backward.h (rb_frame_method_id_and_class): we had labeled `rb_frame_method_id_and_class()` as deprecated because MRI internal doesn't use it, but we found there are user of this API in external C-extensions. Now we don't have proper alternative API and no time to make alternative API, so I remove "deprecated" label. [Bug #15300] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* complex.c: new APIs for Complexnobu2018-12-121-0/+16
| | | | | | [Feature #15066] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* complex.c: rb_complex_new_polarnobu2018-12-121-1/+2
| | | | | | | | | * complex.c (rb_complex_new_polar): renamed with _new to clarify that it creates a new instance, but is not an instance method. * complex.c (rb_complex_polar): deprecated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enumerator.c: Add rb_arithmetic_sequence_components_tmrkn2018-12-121-1/+7
| | | | | | | Add rb_arithmetic_sequence_components_t struct for encapsulating the components of ArithmeticSequence. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enumerator.c: rb_arithmetic_sequence_extractmrkn2018-12-121-0/+1
| | | | | | | New public C-API for extracting components of Enumerator::ArithmeticSequence or Range. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Define HAVE_STMT_AND_DECL_IN_EXPR and use it [Bug #15293]naruse2018-12-101-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* `script_compiled` TracePoint event [Feature #15287]ko12018-12-061-0/+1
| | | | | | | | | | | | | | | | | * vm_trace.c: add `script_compiled` event. This event invoked after script compiling and before evaluating compiled script. Also the following methods are added: `TracePoint#compiled_instruction_sequence` method to get compiled `RubyVM::InstructionSequence` instance. `TracePoint#compiled_eval_script` method to get compiled script (String) by *eval methods (return nil if compiling by file). * vm_trace.c (tracepoint_attr_raised_exception): git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Should be true fix for r66200naruse2018-12-061-5/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* refix of r66200naruse2018-12-061-0/+5
| | | | | | | Though internal.h has the prototype, it still shows symbol lookup error... https://rubyci.org/logs/rubyci.s3.amazonaws.com/icc-x64/ruby-trunk/log/20181206T050002Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Introduce "COLDFUNC" function attribute.ko12018-12-053-3/+13
| | | | | | | | | | | * include/ruby/defines.h: introduce "COLDFUNC" function attribute on several compilers for called unlikely functions. Apply to rb_memerror, rb_warn and rb_bug. A patch form methodmissing <lourens@bearmetal.eu>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* make `RARRAY_PTR_USE` more conservertive.ko12018-12-031-6/+41
| | | | | | | | | | | | | | | | | | | * include/ruby/ruby.h: de-transient at `RARRAY_PTR_USE` and `RARRAY_PTR_USE_START`. Introduce `RARRAY_PTR_USE_TRANSIENT` and `RARRAY_PTR_USE_START_TRANSIENT` if you don't want to de-transient an array. Generally, it is difficult so C-extension writers should not use them. * array.c: use `RARRAY_PTR_USE_TRANSIENT` if possible. * hash.c: ditto. * enum.c (enum_sort_by): remove `rb_ary_transient_heap_evacuate()` because `RARRAY_PTR_USE` do de-transient. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* errno.h must be included after config.h because config.h might defineodaira2018-11-211-1/+1
| | | | | | | | | | | _REENTRANT, _THREAD_SAFE, etc., which affect how errno is defined on some architectures * ext/openssl/ossl.h: include errno.h after ruby.h * include/ruby/io.h: include errno.h after ruby/config.h git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby/ruby.h: void rb_scan_args_verifynobu2018-11-191-3/+3
| | | | | | | * include/ruby/ruby.h (rb_scan_args_verify): void the never used result. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * expand tabs.svn2018-11-151-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e