summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2019-06-04Revert "marshal.c: new functions for extensions"Nobuyoshi Nakada
This reverts a commit miss, 24a96a0228ccf355826644a9daad69e11b67b53b.
2019-06-04marshal.c: new functions for extensionsNobuyoshi Nakada
* 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.
2019-05-28Added missing predicate macrosNobuyoshi Nakada
2019-05-28remove obsolete rb_gc_finalize_deferred().Koichi Sasada
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.
2019-05-26Add FrozenError#receiverJeremy Evans
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]
2019-05-23Suppress paranoid warnings for external/3rd-party librariesNobuyoshi Nakada
[Feature #15665]
2019-05-22Eagerly name modules and classesAlan Wu
* 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]
2019-05-18Rename rb_gc_new_location to rb_gc_locationAaron Patterson
The function will return new or existing locations depending on whether or not the object actually moved, so give it a more appropriate name.
2019-05-17Do not call memcpy if copying nothingNobuyoshi Nakada
c.f. * e7b18ca6d9b45b7e71694557b9fab8152c62c1ed * 34e1079aef81d108890fb167d7df69960e994ff5
2019-05-07Reduce ONIG_NREGION from 10 to 4: power of 2 and testing revealed most ↵Lourens Naudé
pattern matches are less than or equal to 4 results Closes: https://github.com/ruby/ruby/pull/2135
2019-04-24Remove member char_offset_updated from struct rmatch as member ↵Lourens Naudé
char_offset_num_allocated can serve the same purpose as that predicate
2019-04-24Only define history_root member of the Oniguruma re_registers struct if ↵Lourens Naudé
USE_CAPTURE_HISTORY is enabled
2019-04-22ViewVC of svn.ruby-lang.org was shutdown status.SHIBATA Hiroshi
2019-04-21Make rb_hash_bulk_insert publicnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20Add `GC.compact` again.tenderlove
🙏 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17Reverting compaction for nowtenderlove
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
2019-04-17Introduce pattern matching [EXPERIMENTAL]ktsj
[ruby-core:87945] [Feature #14912] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17Adding `GC.compact` and compacting GC support.tenderlove
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
2019-04-10* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-10Reverting all commits from r67479 to r67496 because of CI failureskazu
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
2019-04-09fix RMoved definition locationtenderlove
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-09Adding `GC.compact` and compacting GC support.tenderlove
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
2019-02-14Introduce RVALUE_EMBED_LEN_MAX to remove a magic numbermrkn
* 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
2019-01-04introduce rb_nogvl C-API to mark ubf as async-signal-safenormal
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
2018-12-25version.h (RUBY_VERSION): 2.7.0 development has started.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-24remove "deprecated" for rb_frame_method_id_and_class [Bug #15300]ko1
* 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
2018-12-12complex.c: new APIs for Complexnobu
[Feature #15066] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-12complex.c: rb_complex_new_polarnobu
* 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
2018-12-12enumerator.c: Add rb_arithmetic_sequence_components_tmrkn
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
2018-12-12enumerator.c: rb_arithmetic_sequence_extractmrkn
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
2018-12-10Define HAVE_STMT_AND_DECL_IN_EXPR and use it [Bug #15293]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06`script_compiled` TracePoint event [Feature #15287]ko1
* 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
2018-12-06Should be true fix for r66200naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06refix of r66200naruse
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
2018-12-05Introduce "COLDFUNC" function attribute.ko1
* 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
2018-12-03make `RARRAY_PTR_USE` more conservertive.ko1
* 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
2018-11-21errno.h must be included after config.h because config.h might defineodaira
_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
2018-11-19ruby/ruby.h: void rb_scan_args_verifynobu
* 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
2018-11-15* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-15include/ruby/ruby.h (RB_ALLOCV*): remove unnecessary GC guardnormal
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
2018-11-01* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-01introduce USE_TRANSIENT_HEAP to enable/disable theap.ko1
* 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
2018-10-30support theap for T_HASH. [Feature #14989]ko1
* 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
2018-10-30introduce TransientHeap. [Bug #14858]ko1
* 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
2018-10-30revert r65444 and r65446 because of commit missko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30introduce TransientHeap. [Bug #14858]ko1
* 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
2018-10-23Revert "vm_trace: implement postponed_jobs as st_table"normal
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
2018-10-13Define PRIdPTR etcnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-08* remove trailing space. [ci skip]svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-08include/ruby/ruby.h: comment about mswin RUBY_EXTERN [ci skip]k0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e