aboutsummaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* include/ruby/ruby.h (RB_ALLOCV*): remove unnecessary GC guardnormal2018-11-151-2/+2
| | | | | | | | text data bss dec hex filename 3535061 21232 72944 3629237 3760b5 ruby.before 3534141 21232 72944 3628317 375d1d ruby.after git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2018-11-011-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* introduce USE_TRANSIENT_HEAP to enable/disable theap.ko12018-11-011-3/+19
| | | | | | | | * include/ruby/ruby.h: intrdocue `USE_TRANSIENT_HEAP` macro to enable/disable transient heap. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* support theap for T_HASH. [Feature #14989]ko12018-10-303-5/+8
| | | | | | | | | | | | | | | | | * hash.c, internal.h: support theap for small Hash. Introduce RHASH_ARRAY (li_table) besides st_table and small Hash (<=8 entries) are managed by an array data structure. This array data can be managed by theap. If st_table is needed, then converting array data to st_table data. For st_table using code, we prepare "stlike" APIs which accepts hash value and are very similar to st_ APIs. This work is based on the GSoC achievement by tacinight <tacingiht@gmail.com> and refined by ko1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* introduce TransientHeap. [Bug #14858]ko12018-10-301-5/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * transient_heap.c, transient_heap.h: implement TransientHeap (theap). theap is designed for Ruby's object system. theap is like Eden heap on generational GC terminology. theap allocation is very fast because it only needs to bump up pointer and deallocation is also fast because we don't do anything. However we need to evacuate (Copy GC terminology) if theap memory is long-lived. Evacuation logic is needed for each type. See [Bug #14858] for details. * array.c: Now, theap for T_ARRAY is supported. ary_heap_alloc() tries to allocate memory area from theap. If this trial sccesses, this array has theap ptr and RARRAY_TRANSIENT_FLAG is turned on. We don't need to free theap ptr. * ruby.h: RARRAY_CONST_PTR() returns malloc'ed memory area. It menas that if ary is allocated at theap, force evacuation to malloc'ed memory. It makes programs slow, but very compatible with current code because theap memory can be evacuated (theap memory will be recycled). If you want to get transient heap ptr, use RARRAY_CONST_PTR_TRANSIENT() instead of RARRAY_CONST_PTR(). If you can't understand when evacuation will occur, use RARRAY_CONST_PTR(). (re-commit of r65444) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r65444 and r65446 because of commit missko12018-10-301-25/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* introduce TransientHeap. [Bug #14858]ko12018-10-301-5/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * transient_heap.c, transient_heap.h: implement TransientHeap (theap). theap is designed for Ruby's object system. theap is like Eden heap on generational GC terminology. theap allocation is very fast because it only needs to bump up pointer and deallocation is also fast because we don't do anything. However we need to evacuate (Copy GC terminology) if theap memory is long-lived. Evacuation logic is needed for each type. See [Bug #14858] for details. * array.c: Now, theap for T_ARRAY is supported. ary_heap_alloc() tries to allocate memory area from theap. If this trial sccesses, this array has theap ptr and RARRAY_TRANSIENT_FLAG is turned on. We don't need to free theap ptr. * ruby.h: RARRAY_CONST_PTR() returns malloc'ed memory area. It menas that if ary is allocated at theap, force evacuation to malloc'ed memory. It makes programs slow, but very compatible with current code because theap memory can be evacuated (theap memory will be recycled). If you want to get transient heap ptr, use RARRAY_CONST_PTR_TRANSIENT() instead of RARRAY_CONST_PTR(). If you can't understand when evacuation will occur, use RARRAY_CONST_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "vm_trace: implement postponed_jobs as st_table"normal2018-10-231-1/+5
| | | | | | | | | This reverts commit 5a1dfb04bc2b09fcf8f3427cac72d0ce52a45eb2 (r63451) And mark the functions as async-signal-safe while we're at it to prevent future developers from making the same mistake as I did :x git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Define PRIdPTR etcnobu2018-10-131-0/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing space. [ci skip]svn2018-10-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/ruby.h: comment about mswin RUBY_EXTERN [ci skip]k0kubun2018-10-081-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/ruby.h: import external symbolsk0kubun2018-10-081-0/+6
| | | | | | | | | properly on MinGW MJIT. test_jit.rb: all MJIT tests are now passing on MinGW. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/intern.h: don't modify MJIT_FUNC_EXPORTEDk0kubun2018-10-072-4/+6
| | | | | | | | | | | | | | | | on most of platforms except mswin. Changing it to static was needed for mswin because it doesn't use transform_mjit_header, but for platforms that use it, it causes link error like: /usr/bin/ld: /tmp/_ruby_mjit_p21652u0.o: relocation R_X86_64_PC32 against undefined symbol `rb_vm_search_method_slowpath' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status include/ruby/defines.h: MJIT_FUNC_EXPORTED moved to intern.h git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_core.h: fix inconsistent prototype declarationsk0kubun2018-10-071-1/+13
| | | | | | | | | | | | | | | like "error: static declaration of 'xxx' follows non-static declaration". r64940 is successfully built on mswin but not built on almost all other environments. internal.h: ditto include/ruby/intern.h: MJIT_STATIC is moved to this file since this file also needs to use this. mjit.h: MJIT_STATIC is moved from this. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use configure-defined macro instead of __GNUC__shyouhei2018-09-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e