Граф коммитов

2213 Коммитов

Автор SHA1 Сообщение Дата
Peter Zhu 46b66eb9e8 [Feature #18239] Add struct for embedded strings 2021-10-25 13:26:23 -04:00
Shugo Maeda 6606597109
Deprecate include/prepend in refinements and add Refinement#import_methods instead
Refinement#import_methods imports methods from modules.
Unlike Module#include, it copies methods and adds them into the refinement,
so the refinement is activated in the imported methods.

[Bug #17429] [ruby-core:101639]
2021-10-21 16:31:54 +09:00
Nobuyoshi Nakada 702a58e9e5
Remove duplicate type qualifiers
`rb_encoding` is defined as `const OnigEncodingType`.
Fix lots of C4114 warnings for each files by MSVC.
2021-10-06 14:01:43 +09:00
Nobuyoshi Nakada cd182c5ee1
Adjust types to rb_enc_left_char_head
I dislike unnatural casts.
2021-10-05 17:14:29 +09:00
卜部昌平 f032c09bca rb_enc_left_char_head(): take void*
Nobu doesn't like (char*) cast.
2021-10-05 14:18:23 +09:00
卜部昌平 5112a54846 include/ruby/encoding.h: convert macros into inline functions
Less macros == huge win.
2021-10-05 14:18:23 +09:00
卜部昌平 312668cf03 split include/ruby/encoding.h
2,291 lines are too much!  include/ruby/encoding.h became the biggest
header file once it had doxygen comments.  Let us split it into smaller
parts, so that we can better organise their contents.
2021-10-05 14:18:23 +09:00
卜部昌平 2fa4715bf2 rb_ractor_shareable_p(): fix doxygen
My bad.  The document is clearly broken.  Maybe I pressed my delete key
too much. [ci skip]
2021-10-05 14:18:23 +09:00
卜部昌平 90f2ab9d62 rb_fiber_raise(): add doxygen
Must not be a bad idea to improve documents.
2021-09-30 20:55:23 +13:00
Nobuyoshi Nakada f7ffe9dbde
Introduce `RBIMPL_NONNULL_ARG` macro
Runtime assertion for the argument declared as non-null.
This macro does nothing if `RBIMPL_ATTR_NONNULL` is effective,
otherwise asserts that the argument is non-null.
2021-09-27 14:47:52 +09:00
Nobuyoshi Nakada 63297c2ca4
Align the implementation precedences with `rb_atomic_t` definition
On MinGW, where both of Win32 API and GCC built-ins are available,
the mismatch of implementations to the definition caused lots of
warnings.
2021-09-24 10:11:32 +09:00
卜部昌平 0dea31c437 RBIMPL_ATTR_NOALIAS: not until LLVM 12
I observed CI failures.
https://github.com/ruby/ruby/actions/runs/1240165911

It turns out that  RBIMPL_ATTR_NOALIAS was not mature before.  Skip
using it for old clang, and everything work as expected.
2021-09-22 16:37:13 +09:00
卜部昌平 ecaf3a391d include/ruby/atomic.h: rework
Reduce macros to do the same things in inline functions instead.  This
way assertions can be made granular.
2021-09-22 16:37:13 +09:00
Samuel Williams 88ba5fe547 Expose `rb_fiber_raise` and tidy up the internal implementation. 2021-09-20 18:30:51 +12:00
卜部昌平 63ab2fedc8 include/ruby/atomic.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-15 09:25:23 +09:00
Nobuyoshi Nakada b568e6a130
Suppress deprecated rb_iterate declaration warnings in C++
Apply commit:733ffa74cd32a5c11ff744a5490782daa00ff1ae again.
2021-09-11 17:54:11 +09:00
Nobuyoshi Nakada cd829bb078 Remove printf family from the mjit header
Linking printf family functions makes mjit objects to link
unnecessary code.
2021-09-11 08:41:32 +09:00
卜部昌平 c39dd708b5 suppress GCC's -Wmissing-attribute
I was not aware of this because I use clang these days.
2021-09-10 20:00:06 +09:00
卜部昌平 6522b51ce5 rb_ary_new_from_values: can take NULLs
Explicit check done at runtime.
2021-09-10 20:00:06 +09:00
卜部昌平 dddc618d30 suppress GCC's -Wsuggest-attribute=format
I was not aware of this because I use clang these days.
2021-09-10 20:00:06 +09:00
卜部昌平 fd12bc1896 ruby_scan_oct, ruby_scan_hex: are not pure
Silly bug, they write back consumed bytes through passed pointers.  Must
never be pure functions.

ruby_scan_oct does not refer any static variables so it can still be
__declspec(noalias), while ruby_scan_hex is not because it reads from
ruby_digit36_to_number_table.
2021-09-10 20:00:06 +09:00
卜部昌平 4f03930d04 ruby_cleanup: fix MSVC compile error
See https://ci.appveyor.com/project/ruby/ruby/builds/40686153/job/1wihxw5m5kybtohj
2021-09-10 20:00:06 +09:00
卜部昌平 676073b62e include/ruby.h: skip doxygen
Everything defined in this header file are for backwards compatibility
only.  No one practically need them any longer. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 4702b59f21 include/ruby/backward.h: skip doxygen
There is nothing interesting here. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 6420db8ab7 include/ruby/debug.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 1563526edf include/ruby/defines.h: add doxygen
The only thing that remains in this file which is still worth
documenting is the RUBY macro.  Everything else were split into many
files in
1ff4cee2b1

[ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 6e8e2b467b forgot to delete a redundant comment 2021-09-10 20:00:06 +09:00
卜部昌平 3ca688aeb0 include/ruby/encoding.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 84b96298b3 include/ruby/fiber/scheduler.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 809138fe4b include/ruby/io.h: add doxyen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 6204b0dd99 include/ruby/memory_view.h: add doxygen
I'm just applying doc/memory_view.md as a doxygen comment. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 5a79439a68 include/ruby/missing.h: skip doxygen
We don't want to document e.g. M_PI, which is an ISO C thing.
2021-09-10 20:00:06 +09:00
卜部昌平 56c0475036 include/ruby/ractor.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 2c4dccad33 include/ruby/random.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 1c9106da8b include/ruby/re.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 4c14c55505 include/ruby/regex.h: skip doxygen
It seems this is a part of Onigmo's API, not Ruby's.
2021-09-10 20:00:06 +09:00
卜部昌平 e18bc14a05 include/ruby/ruby.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 4912260b70 include/ruby/subst.h: skip doxygen
Nothing worth documenting in this file. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 a50287ab03 include/ruby/thread.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 53e0d7eec7 include/ruby/thread_native.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 eb39497ecf include/ruby/util.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 99dd95806d include/ruby/version.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 072d74cc7a include/ruby/vm.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 ba814a5aa3 include/ruby/backward/2/assume.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 5107a6bf12 include/ruby/backward/2/attributes.h: skip doxygen
These macros are for backwards compatibility.  No longer used in our
public header files.  People can safely forget about them.
[ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 07240056f9 include/ruby/backward/2/bool.h: skip doxygen
It's 21st century, right?  Just forget about them. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 c0b5d95cc0 include/ruby/backward/2/gcc_version_since.h: skip doxygen
It seems no public APIs depend on this macro any longer. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 5868ebf46e include/ruby/backward/2/inttypes.h: skip dpxygen
These macros need not be documented methinks. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 0f9cf6d4d0 include/ruby/backward/2/limits.h: skip doxygen
For instane CHAR_BIT is an ANSI C macro which should be documented in
other places than Ruby (and the definition in this file must work
exactly identical to that of standard one). [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 7ead69068e include/ruby/backward/2/long_long.h: add doxygen
Might want to delete LONG_LONG macro but for the time being let us
describe what on earth it is. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 f05dc8b44a include/ruby/backward/2/r_cast.h: skip doxygen
Nobody practically uses this file.  Please just don't remember.
[ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 e5a1efb72a include/ruby/backward/2/rmodule.h: skip doxygen
These macros are considered archaic. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 c4693b8a5b include/ruby/backward/2/stdalign.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 8a469f1c25 include/ruby/backward/2/stdarg.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 5453031fd4 include/ruby/backward/cxxanyargs.hpp: addo doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 cac1e88d75 include/ruby/backward/cxxanyargs.hpp: suppress doxygen warning
rb_cFiber is not visible from extension libraries, hence intentionally
not documented. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 9eab1e9107 include/ruby/internal/arithmetic/char.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 6e62cf46ed include/ruby/internal/arithmetic/double.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 887c1f117d include/ruby/internal/arithmetic/fixnum.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 98ab286195 include/ruby/internal/arithmetic/gid_t.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 5e1caeb15c include/ruby/internal/arithmetic/int.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 8fa82cd272 include/ruby/internal/arithmetic/intptr_t.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 6706d0216f include/ruby/internal/arithmetic/long.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 abd15ac775 include/ruby/internal/arithmetic/long_long.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 e9c423ac6c include/ruby/internal/arithmetic/mode_t.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 92150fde85 include/ruby/internal/arithmetic/off_t.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 5289552e53 include/ruby/internal/arithmetic/pid_t.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 009c6b742b include/ruby/internal/arithmetic/short.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 5c3cd09715 include/ruby/internal/arithmetic/size_t.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 86d4fe686c include/ruby/internal/arithmetic/st_data_t.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 edf1964bdf include/ruby/internal/arithmetic/uid_t.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 0ea157136f postscript about rb_mutex_sleep
Asked ko1 about the design.  [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 ce54282b75 include/ruby/internal/intern/array.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 f9a00f9ef2 include/ruby/internal/intern/bignum.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 fbe1fcd82d include/ruby/internal/intern/class.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 5f478d8ac3 include/ruby/internal/intern/compar.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 0375f1fe97 include/ruby/internal/intern/complex.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 0f3ae58882 include/ruby/internal/intern/cont.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 974a9e4fba include/ruby/internal/intern/dir.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 0a7034258f include/ruby/internal/intern/enum.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 407c4850f1 include/ruby/internal/intern/enumerator.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 d5460f1cda include/ruby/internal/intern/error.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 3fa875f88b include/ruby/internal/intern/eval.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 e3b94182a0 include/ruby/internal/intern/file.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 ba42d35dd0 include/ruby/internal/intern/gc.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 990a6c789a include/ruby/internal/intern/hash.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 398be8bc92 include/ruby/internal/intern/io.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 63aef9b177 include/ruby/internal/intern/load.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 72a43d4a4b include/ruby/internal/intern/marshal.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 14e6e122e7 include/ruby/internal/intern/numeric.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 d43accae15 include/ruby/internal/intern/object.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 4f97917474 include/ruby/internal/intern/parse.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 26b7efc51c include/ruby/internal/intern/proc.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 15255b303c include/ruby/internal/intern/process.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 357a43558e include/ruby/internal/intern/random.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 949220d9db include/ruby/internal/intern/range.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 7c8ad0a37d include/ruby/internal/intern/rational.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 06127fe4ae include/ruby/internal/intern/re.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 9d91878b79 include/ruby/internal/intern/ruby.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 4625ab88e2 include/ruby/internal/intern/select.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 29201e1ad2 include/ruby/internal/intern/select/largesize.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 20716f64e9 include/ruby/internal/intern/select/posix.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 515f8d0967 include/ruby/internal/intern/select/win32.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 65ec170618 include/ruby/internal/intern/signal.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 772ad7718b include/ruby/internal/intern/sprintf.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 091faca99c include/ruby/internal/intern/string.h: add doygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 1bdae3773f include/ruby/internal/intern/struct.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 45803af58c include/ruby/internal/intern/thread.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 a88bd246ca include/ruby/internal/intern/time.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 cbf9fc6b02 include/ruby/internal/intern/variable.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 43cac51277 include/ruby/internal/intern/vm.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 8b0dbca2f4 include/ruby/internal/core/rarray.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 a2b8f61cba include/ruby/internal/core/rbasic.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 9c4aa94a19 include/ruby/internal/core/rbignum.h: add doxgen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 7c28330ca0 include/ruby/internal/core/rclass.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 005ff5da52 include/ruby/internal/core/rdata.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 0c486c5531 include/ruby/internal/core/rfile.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 b92a9af405 include/ruby/internal/core/rhash.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 b40d74ce69 include/ruby/internal/core/rmatch.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 549e9383e4 include/ruby/internal/core/robject.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 ada4a0fdd2 include/ruby/internal/core/rregexp.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 1bd1339492 include/ruby/internal/core/rstring.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 746996e6c9 include/ruby/internal/core/rstruct.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 fdae26a5a8 include/ruby/internal/core/rtypeddata.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 1561012918 include/ruby/internal/anyargs.h: fix typo
RBIMPL_ATTR_NONNULL macro takes an argument.
2021-09-10 20:00:06 +09:00
卜部昌平 618fa0a67b include/ruby/internal/anyargs.h: fix typo
Just applied spell checker. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 cf1424d62a include/ruby/internal/cast.h: skip doxygen
This header contains nothing worth documenting. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 b5e491fb45 include/ruby/internal/compiler_is: skip doxygen
We don't want 3rd parties to use these RBIMPL_ macros.  Let's not
document them. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 924d78f87d include/ruby/internal/config.h: skip doxygen
It is definitely desirable to document them, but we need more human
resources.  Tentatively disable documenting them. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 b7cd9a3b79 include/ruby/internal/constant_p.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 538a3919d9 include/ruby/internal/ctype.h: add doxygen
Must not be a bad idea to improve documents.
2021-09-10 20:00:06 +09:00
卜部昌平 9febab7afc include/ruby/internal/dllexport.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 0d13f5aa73 include/ruby/internal/dosish.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 30f3319871 include/ruby/internal/eval.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 ee94fb44f4 include/ruby/internal/event.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 99c3328edc include/ruby/internal/error.h: name a parameter
Better document [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 891dbedd00 include/ruby/internal/error.h: refactor move contents around [ci skip] 2021-09-10 20:00:06 +09:00
卜部昌平 1b6245ccdc include/ruby/internal/error.h: add doxygen
Must not be a bad idea to improve documents.
2021-09-10 20:00:06 +09:00
卜部昌平 4881a3ed38 include/ruby/internal/fl_type.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 fbe0785a34 include/ruby/internal/glob.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 3be4adcf2b include/ruby/internal/globals.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 f83b14af24 include/ruby/internal/interpreter.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]

In fact many functions declared in the header file are already
documented more or less.  They were just copy & pasted, with applying
some style updates.
2021-09-10 20:00:06 +09:00
卜部昌平 03fd22a170 include/ruby/internal/iterator.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 4397e737c5 include/ruby/internal/memory.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 00ff6b68e4 include/ruby/internal/method.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]

In fact many functions declared in the header file are already
documented more or less.  They were just copy & pasted, with applying
some style updates.
2021-09-10 20:00:06 +09:00
卜部昌平 9ba9dbf168 include/ruby/internal/module.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]

In fact many functions declared in the header file are already
documented more or less.  They were just copy & pasted, with applying
some style updates.
2021-09-10 20:00:06 +09:00
卜部昌平 1f66d8a77b include/ruby/internal/newobj.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 c3c0bf6823 include/ruby/internal/rgengc.h: add dosygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 2061dadb0a include/ruby/internal/scan_args.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 b0a7c0dfd0 include/ruby/internal/special_consts.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 818fabfcd9 include/ruby/internal/stdalign.h: add doxygen
Unlike other "add doxygen" commits this one adds a preprocessor branch
that doxygen would process.  This prevents it from parsing other parts
of the file.
2021-09-10 20:00:06 +09:00
卜部昌平 73d2bf97c1 include/ruby/internal/symbol.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 178ce74597 include/ruby/internal/value.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 e2a441bdd4 include/ruby/internal/value_type.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 3341e178ef include/ruby/internal/variable.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 13be4c0342 include/ruby/internal/warning_push.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 28b7b0e13e include/ruby/internal/xmalloc.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 a300133b4a include/ruby/internal/xmalloc.h: fix typo [ci skip] 2021-09-10 20:00:06 +09:00
卜部昌平 b6469c3aaf template/Doxyfile.tmpl: add alias
This enables me to write `@shyouhei` in C comments without complained by
doxygen that @shyouhei is an unknown special command. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 94e5953b48 sed -i 's/. They/. They/'
Truly editorial fix for comments.  This works better with Emacs'
set-justification-full function. [ci skip]
2021-09-10 20:00:06 +09:00
Kenta Murata f8bb2d9b27
memory_view.c: Rename private to private_data for C++ (#4812)
* memory_view.c: Rename private to private_data for C++

* doc/memory_view.md: Update document

* Fix doc/memory_view.md

Co-authored-by: Sutou Kouhei <kou@cozmixng.org>

Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
2021-09-06 16:01:52 +09:00
Nobuyoshi Nakada 80c1faf076
Use C99-defined signbit macro 2021-08-27 12:42:23 +09:00
Nobuyoshi Nakada 04be8e84db
Use C99-defined macros to classify a floating-point number 2021-08-27 12:41:30 +09:00
Peter Zhu c08d4067be [Feature #18045] Remove T_PAYLOAD
This commit removes T_PAYLOAD since the new VWA implementation no longer
requires T_PAYLOAD types.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-08-25 09:28:21 -04:00
Nobuyoshi Nakada d9f084ed14 Moved rb_deprecate_constant declaration [Feature #18051] 2021-08-24 10:37:41 +09:00
Nobuyoshi Nakada 5d99800d01 Moved rb_int_positive_pow declaration [Feature #18051] 2021-08-24 10:37:41 +09:00
Nobuyoshi Nakada c38c2d8ee2 Moved exported symbols in internal/util.h to ruby/util.h
[Feature #18051]
2021-08-24 10:37:41 +09:00
Peter Zhu eddd369e73 Revert "[Feature #18045] Implement size classes for GC"
This reverts commits 48ff7a9f3e
and b2e2cf2ded because it is causing
crashes in SPARC solaris and i386 debian.
2021-08-23 10:54:53 -04:00
Peter Zhu 48ff7a9f3e [Feature #18045] Remove T_PAYLOAD
This commit removes T_PAYLOAD since the new VWA implementation no longer
requires T_PAYLOAD types.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-08-23 09:15:42 -04:00
Kazuki Tsujimoto 4568ba0711
Show verbose error messages when single pattern match fails
[0] => [0, *, a]
    #=> [0] length mismatch (given 1, expected 2+) (NoMatchingPatternError)

Ignore test failures of typeprof caused by this change for now.
2021-08-15 09:38:24 +09:00
Nobuyoshi Nakada edd27e120e A comment for typed data in `rb_check_type` [ci skip] 2021-08-14 23:11:58 +09:00
Nobuyoshi Nakada d58620e0a1 Rename labels in `Check_Type` more descriptive 2021-08-14 23:11:58 +09:00
Nobuyoshi Nakada 611da9faef
Mark `rb_unexpected_type` as "cold" [Bug #18062]
So that it will not interfere the fast path in `Check_Type`.
2021-08-13 13:29:15 +09:00
Nobuyoshi Nakada 573eef7c89
Indicate the slow path of `Check_Type` never return [Bug #18062]
Though this call to `rb_check_type` is just to raise an exception
and never return actually, it can return at least formally.  That
means a caller function looks like it will access `flags` even in
the special-const cases, and some optimizers may unify the access
with the same access just following the call, and re-order it
before the guard.
2021-08-13 13:29:15 +09:00
卜部昌平 1cdc75104d RBIMPL_ATTR_DEPRECATED: enable for GCC 10.3+
They fixed the bug.
2021-08-12 11:29:08 +09:00
Nobuyoshi Nakada 9ed196e487
VC warns the same attribute used more than once 2021-08-09 19:25:18 +09:00
Nobuyoshi Nakada 93ddff4802
Rename rb_iterate to get rid of name clash on Sun C 2021-08-09 17:36:21 +09:00
Nobuyoshi Nakada 4fb8a12adc Deprecate rb_iterate in C++ 2021-08-09 11:21:56 +09:00
Nobuyoshi Nakada 733ffa74cd Suppress deprecated rb_iterate declaration warnings in C++ 2021-08-09 11:21:56 +09:00
Nobuyoshi Nakada a14671a6b6 Suppress warnings in C++2a
* bitwise operation between different enumeration types
  ('ruby_value_type' and 'ruby_fl_type') is deprecated
  [-Wdeprecated-enum-enum-conversion]

* volatile-qualified parameter type 'volatile int' is deprecated
  [-Wdeprecated-volatile]
2021-08-09 11:21:56 +09:00
Nobuyoshi Nakada 605421f4eb
gcc 10.3.0 says "__VA_OPT__ is not available until C++2a" 2021-08-01 09:54:36 +09:00
Nobuyoshi Nakada 3b52230452
Define functions using rb_wait_for_single_fd [Bug #18046] 2021-08-01 06:49:07 +09:00
Benoit Daloze fd0df9c4fb Emit deprecatation warnings for rb_iterate()
* It is obsolete since 1.9, see
  https://github.com/ruby/ruby/blob/master/doc/extension.rdoc#label-Control+Structure
  and [Misc #18025]
2021-07-16 12:11:24 +02:00
卜部昌平 3ce2bf4d90 rb_interned_id_p: does not exist
This declaration was added at commit 0ee5a49dd4
without its implementation.  Must be a mistake.

Note also that we ended up having this exct same functionality
implemented under a name of rb_check_id().
2021-07-15 16:54:59 +09:00
卜部昌平 2d9aacf644 rb_enc_casefold: does not exist
This declaration was added at commit 0ee5a49dd4
without its implementation.  Must be a mistake.
2021-07-15 16:54:59 +09:00
xtkoba 29f6f79e73 Get `ruby_nonempty_memcpy` to have C linkage
Fixes [Bug #17788]
2021-07-13 22:55:17 +09:00
Samuel Williams 9df712a0e2 Expose `rb_obj_is_fiber`. 2021-07-13 19:28:40 +12:00
Yusuke Endoh 457a4913be Disable RBIMPL_ATTR_DEPRECATED for Coverity Scan build
Coverity Scan emulates gcc but seems not to support this attribute
correctly.
2021-06-26 02:30:23 +09:00
Nobuyoshi Nakada 8f16a715e1
Revert deprecations for now 2021-06-23 12:41:54 +09:00
Samuel Williams 45e65f302b Deprecate and rework old (fd) centric functions. 2021-06-22 22:48:57 +12:00
Samuel Williams 3deb5d7113 Direct io for accept, send, sendmsg, recvfrom, and related methods. 2021-06-22 22:17:53 +12:00
eileencodes b91b3bc771 Add a cache for class variables
Redo of 34a2acdac788602c14bf05fb616215187badd504 and
931138b00696419945dc03e10f033b1f53cd50f3 which were reverted.

GitHub PR #4340.

This change implements a cache for class variables. Previously there was
no cache for cvars. Cvar access is slow due to needing to travel all the
way up th ancestor tree before returning the cvar value. The deeper the
ancestor tree the slower cvar access will be.

The benefits of the cache are more visible with a higher number of
included modules due to the way Ruby looks up class variables. The
benchmark here includes 26 modules and shows with the cache, this branch
is 6.5x faster when accessing class variables.

```
compare-ruby: ruby 3.1.0dev (2021-03-15T06:22:34Z master 9e5105c) [x86_64-darwin19]
built-ruby: ruby 3.1.0dev (2021-03-15T12:12:44Z add-cache-for-clas.. c6be009) [x86_64-darwin19]

|         |compare-ruby|built-ruby|
|:--------|-----------:|---------:|
|vm_cvar  |      5.681M|   36.980M|
|         |           -|     6.51x|
```

Benchmark.ips calling `ActiveRecord::Base.logger` from within a Rails
application. ActiveRecord::Base.logger has 71 ancestors. The more
ancestors a tree has, the more clear the speed increase. IE if Base had
only one ancestor we'd see no improvement. This benchmark is run on a
vanilla Rails application.

Benchmark code:

```ruby
require "benchmark/ips"
require_relative "config/environment"

Benchmark.ips do |x|
  x.report "logger" do
    ActiveRecord::Base.logger
  end
end
```

Ruby 3.0 master / Rails 6.1:

```
Warming up --------------------------------------
              logger   155.251k i/100ms
Calculating -------------------------------------
```

Ruby 3.0 with cvar cache /  Rails 6.1:

```
Warming up --------------------------------------
              logger     1.546M i/100ms
Calculating -------------------------------------
              logger     14.857M (± 4.8%) i/s -     74.198M in   5.006202s
```

Lastly we ran a benchmark to demonstate the difference between master
and our cache when the number of modules increases. This benchmark
measures 1 ancestor, 30 ancestors, and 100 ancestors.

Ruby 3.0 master:

```
Warming up --------------------------------------
            1 module     1.231M i/100ms
          30 modules   432.020k i/100ms
         100 modules   145.399k i/100ms
Calculating -------------------------------------
            1 module     12.210M (± 2.1%) i/s -     61.553M in   5.043400s
          30 modules      4.354M (± 2.7%) i/s -     22.033M in   5.063839s
         100 modules      1.434M (± 2.9%) i/s -      7.270M in   5.072531s

Comparison:
            1 module: 12209958.3 i/s
          30 modules:  4354217.8 i/s - 2.80x  (± 0.00) slower
         100 modules:  1434447.3 i/s - 8.51x  (± 0.00) slower
```

Ruby 3.0 with cvar cache:

```
Warming up --------------------------------------
            1 module     1.641M i/100ms
          30 modules     1.655M i/100ms
         100 modules     1.620M i/100ms
Calculating -------------------------------------
            1 module     16.279M (± 3.8%) i/s -     82.038M in   5.046923s
          30 modules     15.891M (± 3.9%) i/s -     79.459M in   5.007958s
         100 modules     16.087M (± 3.6%) i/s -     81.005M in   5.041931s

Comparison:
            1 module: 16279458.0 i/s
         100 modules: 16087484.6 i/s - same-ish: difference falls within error
          30 modules: 15891406.2 i/s - same-ish: difference falls within error
```

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-06-18 10:02:44 -07:00
Nobuyoshi Nakada e4f891ce8d
Adjust styles [ci skip]
* --braces-after-func-def-line
* --dont-cuddle-else
* --procnames-start-lines
* --space-after-for
* --space-after-if
* --space-after-while
2021-06-17 10:13:40 +09:00
Samuel Williams 2792acc8f2
Add scheduler hook `Addrinfo.getaddrinfo`. (#4375)
Co-authored-by: Bruno Sutic <code@brunosutic.com>
2021-06-14 16:21:08 +12:00
Samuel Williams dc25412042 Expose `rb_fiber_transfer` and `rb_fiber_transfer_kw`. 2021-06-03 20:47:31 +12:00
Aaron Patterson 07f055bb13
Revert "Filling cache values on cvar write"
This reverts commit 08de37f9fa.
This reverts commit e8ae922b62.
2021-05-11 13:31:00 -07:00
eileencodes e8ae922b62 Add a cache for class variables
This change implements a cache for class variables. Previously there was
no cache for cvars. Cvar access is slow due to needing to travel all the
way up th ancestor tree before returning the cvar value. The deeper the
ancestor tree the slower cvar access will be.

The benefits of the cache are more visible with a higher number of
included modules due to the way Ruby looks up class variables. The
benchmark here includes 26 modules and shows with the cache, this branch
is 6.5x faster when accessing class variables.

```
compare-ruby: ruby 3.1.0dev (2021-03-15T06:22:34Z master 9e5105ca45) [x86_64-darwin19]
built-ruby: ruby 3.1.0dev (2021-03-15T12:12:44Z add-cache-for-clas.. c6be0093ae) [x86_64-darwin19]

|         |compare-ruby|built-ruby|
|:--------|-----------:|---------:|
|vm_cvar  |      5.681M|   36.980M|
|         |           -|     6.51x|
```

Benchmark.ips calling `ActiveRecord::Base.logger` from within a Rails
application. ActiveRecord::Base.logger has 71 ancestors. The more
ancestors a tree has, the more clear the speed increase. IE if Base had
only one ancestor we'd see no improvement. This benchmark is run on a
vanilla Rails application.

Benchmark code:

```ruby
require "benchmark/ips"
require_relative "config/environment"

Benchmark.ips do |x|
  x.report "logger" do
    ActiveRecord::Base.logger
  end
end
```

Ruby 3.0 master / Rails 6.1:

```
Warming up --------------------------------------
              logger   155.251k i/100ms
Calculating -------------------------------------
```

Ruby 3.0 with cvar cache /  Rails 6.1:

```
Warming up --------------------------------------
              logger     1.546M i/100ms
Calculating -------------------------------------
              logger     14.857M (± 4.8%) i/s -     74.198M in   5.006202s
```

Lastly we ran a benchmark to demonstate the difference between master
and our cache when the number of modules increases. This benchmark
measures 1 ancestor, 30 ancestors, and 100 ancestors.

Ruby 3.0 master:

```
Warming up --------------------------------------
            1 module     1.231M i/100ms
          30 modules   432.020k i/100ms
         100 modules   145.399k i/100ms
Calculating -------------------------------------
            1 module     12.210M (± 2.1%) i/s -     61.553M in   5.043400s
          30 modules      4.354M (± 2.7%) i/s -     22.033M in   5.063839s
         100 modules      1.434M (± 2.9%) i/s -      7.270M in   5.072531s

Comparison:
            1 module: 12209958.3 i/s
          30 modules:  4354217.8 i/s - 2.80x  (± 0.00) slower
         100 modules:  1434447.3 i/s - 8.51x  (± 0.00) slower
```

Ruby 3.0 with cvar cache:

```
Warming up --------------------------------------
            1 module     1.641M i/100ms
          30 modules     1.655M i/100ms
         100 modules     1.620M i/100ms
Calculating -------------------------------------
            1 module     16.279M (± 3.8%) i/s -     82.038M in   5.046923s
          30 modules     15.891M (± 3.9%) i/s -     79.459M in   5.007958s
         100 modules     16.087M (± 3.6%) i/s -     81.005M in   5.041931s

Comparison:
            1 module: 16279458.0 i/s
         100 modules: 16087484.6 i/s - same-ish: difference falls within error
          30 modules: 15891406.2 i/s - same-ish: difference falls within error
```

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-05-11 12:04:27 -07:00
Nobuyoshi Nakada 2d67027448 Removed missing/dup2.c
This function should be always available, as POSIX-compliant or
Windows platform are required since 1.9.  Also the code in this
file is MT-unsafe.
2021-05-10 15:59:23 +09:00
卜部昌平 043ac94db6 rb_fiber_new_kw: doesn't exist
Not against having such thing but currently we lack one.
2021-05-10 11:18:14 +09:00
Nobuyoshi Nakada 0bbab1e515
Protoized old pre-ANSI K&R style declarations and definitions 2021-05-07 00:04:36 +09:00
Matt Valentine-House 8bbd319806 Allow newobj_of0 and newobj_slowpath to allocate into multiple heap slots 2021-05-06 09:18:17 -04:00
Peter Zhu b57c7be6a9 Fix compilation errors for c99
ENUM_OVER_INT is sometimes not defined. Use #ifdef instead if #if.
2021-05-04 20:38:03 -04:00
Benoit Daloze d09988502e Fix -Wundef warnings for RBIMPL_HAS_BUILTIN
* See [Feature #17752]
* Defining explicitly to 0 seems the best solution, see https://github.com/ruby/ruby/pull/4428
* For example:
./include/ruby/internal/has/builtin.h:49:33: error: "RBIMPL_HAS_BUILTIN___builtin_assume" is not defined, evaluates to 0 [-Werror=undef]
   49 | # define RBIMPL_HAS_BUILTIN(_) (RBIMPL_HAS_BUILTIN_ ## _)
      |                                 ^~~~~~~~~~~~~~~~~~~
./include/ruby/internal/assume.h:75:7: note: in expansion of macro ‘RBIMPL_HAS_BUILTIN’
   75 | #elif RBIMPL_HAS_BUILTIN(__builtin_assume)
      |       ^~~~~~~~~~~~~~~~~~
2021-05-04 14:56:55 +02:00
Benoit Daloze f108bc32af HAVE_* macros should not be defined with value 0
* See [Feature #17752]
2021-05-04 14:56:55 +02:00
Benoit Daloze f1dcc3da5d Add RBIMPL_RVALUE_EMBED_LEN_MAX neeeded by internal/bignum.h
* It evaluated to 0 before, revealed by -Wundef
* See [Feature #17752]

Co-authored-by: xtkoba (Tee KOBAYASHI) <xtkoba+ruby@gmail.com>
2021-05-04 14:56:55 +02:00
Benoit Daloze 68d6bd0873 Fix trivial -Wundef warnings
* See [Feature #17752]

Co-authored-by: xtkoba (Tee KOBAYASHI) <xtkoba+ruby@gmail.com>
2021-05-04 14:56:55 +02:00
Ryuta Kamizono 33f2ff3bab Fix some typos by spell checker 2021-04-26 10:07:41 +09:00
卜部昌平 97cee1cba6 rb_hash_free(): has never existed.
This is just a hoax.  Nobody have ever implemented a function named as
such.  Also the functionality implied by the name must not be a public
API if any.
2021-04-16 14:41:35 +09:00
Nobuyoshi Nakada 393923b50d
Inline LONG_LONG conversions
Not only NUM2LL, also LL2NUM, ULL2NUM and NUM2ULL.
2021-04-13 14:50:13 +09:00
卜部昌平 f8e1bf283d workaround MSVC error
Previous code failed to compile on MSVC. Log:
https://github.com/ruby/ruby/pull/4371/checks?check_run_id=2304484466

This is possibly due to the fact that:

1. `Data_Wrap_Struct(...)` appears in a source code
2. which expands to `rb_data_object_wrap(...)`
3. which expands to `RUBY_MACRO_SELECT(rb_data_object_wrap_, RUBY_UNTYPED_DATA_WARNING)`
4. which expands to `rb_data_object_wrap_0`
5. which expands to `rb_data_object_wrap`, so far so good, but
6. this is a recursive macro expansion (see step 2).  Everybody stops expanding...
    - in step 4 for MSVC, and
    - in step 5 for GCC etc.

I have no idea why but this proposed changeset prevents MSVC from
stopping at step 4.
2021-04-13 14:30:21 +09:00
卜部昌平 6413dc27dc dependency updates 2021-04-13 14:30:21 +09:00
卜部昌平 f411fcd145 get rid of #pragma GCC diagnostic ignored "-Wundef"
Use of TOKEN_PASTE was a bad idea at the first place.  Just use ##
everywhere.  Nobody practically lacks token pasting.
2021-04-13 14:30:21 +09:00
Samuel Williams 836da24e97 Fix symbol export. 2021-04-10 09:10:08 +12:00
Samuel Williams 3d32c21758 Disable public interface for now. 2021-03-30 18:38:42 +13:00
Samuel Williams 09c865d541 Fix native implementation.
# Conflicts:
#	scheduler.c
2021-03-30 18:38:42 +13:00
Samuel Williams 4c53dc970b Add hook for `Timeout.timeout`. 2021-03-30 18:38:42 +13:00
Nobuyoshi Nakada 1f08b0d18d
Removed dln_a_out
a.out format is considered extinct nowadays.
2021-03-24 20:13:55 +09:00
Kenichi Kamiya 37abe1a220 [Doc] Standardize wording s/sweeped/swept/ 2021-03-23 01:30:27 +09:00
Kenichi Kamiya 2d6617d327
Fix typos in rhash.h (#4292) 2021-03-19 19:12:03 -07:00
Nobuyoshi Nakada 1d1b9e02d2
Removed a typo in a comment [ci skip] 2021-03-07 10:21:03 +09:00
卜部昌平 45b3a5f7de rb_sym_interned_p: doesn't exist
Deleted decades ago in commit 6e0fed271c

Note also that we eventually ended up reinventing this exact same
functionality.  It is called rb_check_id() now.
2021-03-05 17:37:16 +09:00
卜部昌平 294c244ac8 rb_random_int: ended before it begins
It existed since f3d022543e until
9676023607.  No official releases included
the actual function.  The declaration shall be deleted.
2021-02-25 16:26:54 +09:00
Marvin Schmidt dbeddfb0b2
Make global ruby namespace usage explicit
If the use of the ruby namespace isn't prepended by `::` to make it
explicit that the global ruby namespace is referenced here, it can
clash with other non-global namespace named ruby, e.g.

```
  // declaration
  namespace myproject {
  namespace ruby {
    // my ruby classes
  }
  }

  // implementation
  using namespace myproject;

  [...]

  rb_define_method(...);

  [...]
```

leads to the following error:

```
../ruby/choice.cc: In function 'void {anonymous}::do_register_choice()':
../ruby/choice.cc:342:9: error: reference to 'ruby' is ambiguous
  342 |         rb_define_method(c_choices, "each", RUBY_FUNC_CAST(&choices_each), 0);
      |         ^~~~~~~~~~~~~~~~
In file included from ../ruby/choice.cc:20:
../ruby/paludis_ruby.hh:53:15: note: candidates are: 'namespace paludis::ruby { }'
   53 |     namespace ruby
      |               ^~~~
In file included from /usr/x86_64-pc-linux-gnu/include/ruby-3.0/ruby/backward/2/stdalign.h:23,
                 from /usr/x86_64-pc-linux-gnu/include/ruby-3.0/ruby/defines.h:77,
                 from /usr/x86_64-pc-linux-gnu/include/ruby-3.0/ruby/ruby.h:23,
                 from /usr/x86_64-pc-linux-gnu/include/ruby-3.0/ruby.h:38,
                 from ../ruby/paludis_ruby.hh:44,
                 from ../ruby/choice.cc:20:
/usr/x86_64-pc-linux-gnu/include/ruby-3.0/ruby/internal/stdalign.h:92:11: note:                 'namespace ruby { }'
   92 | namespace ruby {
      |           ^~~~
In file included from /usr/x86_64-pc-linux-gnu/include/ruby-3.0/ruby/internal/anyargs.h:83,
                 from /usr/x86_64-pc-linux-gnu/include/ruby-3.0/ruby/ruby.h:24,
                 from /usr/x86_64-pc-linux-gnu/include/ruby-3.0/ruby.h:38,
                 from ../ruby/paludis_ruby.hh:44,
                 from ../ruby/choice.cc:20:
../ruby/choice.cc:342:9: error: '::define' has not been declared
  342 |         rb_define_method(c_choices, "each", RUBY_FUNC_CAST(&choices_each), 0);
      |         ^~~~~~~~~~~~~~~~
../ruby/choice.cc:344:9: error: reference to 'ruby' is ambiguous
  344 |         rb_define_method(c_choices, "find_by_name_with_prefix", RUBY_FUNC_CAST(&choices_find_by_name_with_prefix), 1);
      |         ^~~~~~~~~~~~~~~~
```
2021-02-14 22:12:32 +09:00
Nobuyoshi Nakada 96441b91a6
Define macro for fiber/scheduler.h 2021-02-09 17:15:29 +09:00
Nobuyoshi Nakada e7416b4c7e
Updated pre-prototype declarations 2021-02-09 17:11:14 +09:00
Samuel Williams 5f69a7f604
Expose scheduler as public interface & bug fixes. (#3945)
* Rename `rb_scheduler` to `rb_fiber_scheduler`.

* Use public interface if available.

* Use `rb_check_funcall` where possible.

* Don't use `unblock` unless the fiber was non-blocking.
2021-02-09 19:39:56 +13:00
卜部昌平 b0d6563f13 rb_clear_method_cache_by_class: no longer exist
It is questionable whether we can change a public API but this function
does not exist today.  No way.
2021-02-04 12:34:19 +09:00
卜部昌平 a67afaaa05 Update include/ruby/internal/fl_type.h
https://github.com/ruby/ruby/pull/4100#pullrequestreview-576059827

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2021-01-27 09:30:15 +09:00
卜部昌平 d205370b96 include/ruby/internal/fl_type.h: refactor hoist out #if conditions
cf: https://github.com/ruby/ruby/pull/4100#pullrequestreview-575952836
2021-01-27 09:30:15 +09:00
卜部昌平 f8a117f858 kill CLONESETUP and DUPSETUP
They are no longer how Object#clone/Object#dup are defined.  In fact
DUPSETUP is not used from anywhere.  CLONESETUP has only one usage.
Let's not expose them to extension libraries.

cf https://github.com/ruby/ruby/pull/4100#discussion_r563481718
2021-01-27 09:30:15 +09:00
卜部昌平 3f4f10bb60 attributes on enumerators are GCC6-ism
See also https://gcc.gnu.org/gcc-6/changes.html

Clang has this feature when __has_extension(enumerator_attributes) is
set.

MSVC has #pragma deprecated instead.
2021-01-27 09:30:15 +09:00
卜部昌平 c7d1387721 warnings on use of RUBY_FL_TAINT
matz said in [ruby-core:94979]:
> 3.0:
>  * taint/trust/untaint/untrust non-verbose warning when called

This is it, for C extensions.
2021-01-27 09:30:15 +09:00
卜部昌平 0300dec32b kill OBJ_TAINT etc.
Now that RUBY_FL_TAINT is recycled to become new RUBY_FL_SHAREABLE.
Setting/clearing this flag from extension libraries break Ractor.
Especially problematic one is OBJ_INFECT, which would make non-shareable
objects travel across Ractor boundaries.

Such operations should just be prohibited.
2021-01-27 09:30:15 +09:00
卜部昌平 7ccdad7be8 fix OBJ_UNTRUST etc.
It seems I broke them in commit 9e6e39c351
Sorry!
2021-01-27 09:30:15 +09:00
Alan Wu 216e6605a4 Add compaction notes for class/module creation C APIs 2021-01-26 16:24:01 -08:00
Gannon McGibbon 9e0075a3d9 Replace "iff" with "if and only if"
iff means if and only if, but readers without that knowledge might
assume this to be a spelling mistake. To me, this seems like
exclusionary language that is unnecessary. Simply using "if and only if"
instead should suffice.
2021-01-19 12:06:45 -08:00
Nobuyoshi Nakada 66a844fd07 Define printf qualifier prefix fallbacks 2021-01-11 21:13:45 +09:00
Tee KOBAYASHI 0bb62dccf4
Fixed a typo [Bug #17522] 2021-01-09 13:37:41 +09:00
Koichi Sasada d968829afa expose some C-APIs for ractor
expose some C-APIs to try to make ractor utilities on external gems.

* add
  * rb_ractor_local_storage_value_lookup() to check availability
* expose
  * rb_ractor_make_shareable()
  * rb_ractor_make_shareable_copy()
  * rb_proc_isolate() (not public)
  * rb_proc_isolate_bang() (not public)
  * rb_proc_ractor_make_shareable() (not public)
2021-01-06 16:03:09 +09:00
Nobuyoshi Nakada f690eb34e2
Fixed dangling imemo_tmpbuf
The count of rb_alloc_tmp_buffer_with_count is the allocation size
counted in VALUE size but not in the requested element size.

Co-authored-by: Yusuke Endoh <mame@ruby-lang.org>
Co-authored-by: Koichi Sasada <ko1@atdot.net>
2021-01-02 12:11:52 +09:00
Nobuyoshi Nakada 62450e0acf
Fixed missing NORETURN on rb_mod_const_missing 2020-12-31 12:30:13 +09:00
Nobuyoshi Nakada 4b4dc0fac7
Defined RBIMPL_ATTR_DEPRECATED_INTERNAL
Get rid of duplicate attributes, which may be warned or ignored
except for the first.
2020-12-31 12:23:29 +09:00
Nobuyoshi Nakada 0284e7ca62
Replaced deprecation macros
* DECLARE_DEPRECATED_FEATURE with RBIMPL_ATTR_DEPRECATED_SINCE
* DECLARE_DEPRECATED_INTERNAL_FEATURE with RBIMPL_ATTR_INTERNAL
And moved function declarations outside both.
2020-12-30 23:11:09 +09:00
Nobuyoshi Nakada 90dd482061
win32: Declared wait and fixed the return type 2020-12-27 16:49:27 +09:00
Kenta Murata 7a4b8d8700
[memory_view] Fix a comment
A consumer of a MemoryView no longer guards the original object.
[ci skip]
2020-12-25 20:11:01 +09:00
Yukihiro "Matz" Matsumoto c591ab11ce
Development of 3.1.0 started. 2020-12-25 17:09:16 +09:00
Nobuyoshi Nakada b343d54792
Use RBIMPL_COMPILER_{SINCE,BEFORE} for MSVC
Pointed out by @shyouhei.

NOTE: Already we have dropped the support for older MSVCs,
probably prior to 1300 or 1400.  Remove the conditional code,
especially in win32/Makefile.sub.
2020-12-24 16:22:50 +09:00
Koichi Sasada 6f29716f9f shareable_constant_value: experimental_copy
"experimental_everything" makes the assigned value, it means
the assignment change the state of assigned value.
"experimental_copy" tries to make a deep copy and make copyied object
sharable.
2020-12-24 14:28:47 +09:00
Nobuyoshi Nakada 6ed6b85ece Expose atomic operation macros with RUBY prefix
Now we need atomic operations, which are lighter than mutex, more
widely for extension libraries because of Ractor.
2020-12-24 11:43:21 +09:00
Kenta Murata 05a756b332
[memory_view] Fix some grammar issues in a comment 2020-12-24 09:32:54 +09:00