summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2019-08-14io.c: export rb_io_extract_modeencNobuyoshi Nakada
* include/ruby/io.h (rb_io_enc_t): add typedef. * io.c (rb_io_extract_modeenc): export.
2019-08-13Renamed ruby_finalize_{0,1}Nobuyoshi Nakada
And pass rb_execution_context_t as an argument.
2019-08-12Rename rb_gc_mark_no_pin -> rb_gc_mark_movableAaron Patterson
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.
2019-08-12rb_trap_exec has been removed since 1.9Nobuyoshi Nakada
2019-08-06The value of rb_scan_args_verify is never usedNobuyoshi Nakada
2019-08-06Distinguish bad scan format from no argument variablesNobuyoshi Nakada
2019-08-05Use negative-sized array instead of zero-divisionNobuyoshi Nakada
2019-08-05Unused macro argument `varc`Nobuyoshi Nakada
2019-08-05Revert "Always evaluate the expression RUBY_ASSERT_MESG_WHEN just once"Nobuyoshi Nakada
It caused a significant benchmark fall. Some assertions seem to use expressions with side-effects which cannot be inlined. This reverts commit b452c03a14f943ae25338547bd680fce67399d85.
2019-07-25Fix errno at seeking socket/pipe on WindowsNobuyoshi Nakada
[Bug #12230]
2019-07-22constify again.Koichi Sasada
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.
2019-07-19* expand tabs.git
2019-07-19fix shared array terminology.Koichi Sasada
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.
2019-07-15Always evaluate the expression RUBY_ASSERT_MESG_WHEN just onceNobuyoshi Nakada
2019-07-15Enable RUBY_ASSERT_MESG_WHEN when RUBY_DEBUG is turned onNobuyoshi Nakada
2019-07-15introduce RUBY_ASSERT_ALWAYS(expr).Koichi Sasada
RUBY_ASSERT_ALWAYS(expr) ignores NDEBUG (we cannot remove this assertion).
2019-07-14Introduce RUBY_DEBUG flag macroNobuyoshi Nakada
When RUBY_DEBUG is turned on, all RUBY_ASSERT() macros will be enabled regardless RUBY_NDEBUG.
2019-07-14Include ruby/assert.h in ruby/ruby.h so that assertions can be thereNobuyoshi Nakada
2019-07-14* expand tabs.git
2019-07-14Split RUBY_ASSERT and so on under include/rubyNobuyoshi Nakada
2019-06-19Remove IA64 support.Samuel Williams
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