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

1800 Коммитов

Автор SHA1 Сообщение Дата
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
Kenta Murata 01ab29cc28
[memory_view] Make some rb_memroy_view_t members const 2020-12-23 09:24:55 +09:00
Kenta Murata 74652e640a
[memory_view][fiddle] Rename len to byte_size in rb_memory_view_t 2020-12-23 09:24:53 +09:00
Kenta Murata 05014dcb88
[memory_view][fiddle] Use bool for boolean return value 2020-12-23 09:05:07 +09:00
卜部昌平 7898bc9225 rb_cCont: no longer exists
Deleted well over a decade ago in commit 977d66ec99.
2020-12-22 15:25:03 +09:00
Nobuyoshi Nakada 8918a9cf6c Removed rb_cData entity
* Use the wrapper of rb_cObject instead of data access
* Replaced rest of extentions
* Updated the version guard for Data
* Added the version guard of rb_cData
2020-12-22 02:51:49 +09:00
卜部昌平 c30f03d328 Data: delete
Has been deprecated since 684bdf6171.

Matz says in [ruby-core:83954] that Data should be an alias of Object.
Because rb_cData has not been deprecated, let us deprecate the constant
to make it a C-level synonym of rb_cObject.
2020-12-22 02:51:49 +09:00
卜部昌平 fe60480947 include/ruby/internal/xmalloc.h: document rb_eNoMemError
It was my bad, the exception that actually raises is rb_eNoMemError.
[ci skip]
2020-12-21 11:01:01 +09:00
卜部昌平 11656d15e2 include/ruby/internal/xmalloc.h: doxygen tag
`@exception` is an alias of `@throw`.  It might suite Ruby's document
because ruby uses `raise` terminology instead of `throw`. [ci skip]
2020-12-21 11:01:01 +09:00
Nobuyoshi Nakada 37987d9994 win32: Deprecate file CP version functions 2020-12-20 18:34:04 +09:00
Nobuyoshi Nakada 5b98b2ce39 win32: Use UTF-8 as filesystem encoding [Feature #12654]
Co-Authored-By: Dāvis Mosāns <davispuh@gmail.com>
2020-12-20 18:34:04 +09:00
Nobuyoshi Nakada a139318538
Added macros for headers which are not included by ruby.h 2020-12-19 16:38:17 +09:00
Jeremy Evans 7e2dbbda35 Use category: :experimental in warnings that are related to experimental features
This adds rb_category_compile_warn in order to emit compiler warnings
with categories.  Note that Ripper currently ignores the category
for these warnings, but by default it ignores the warnings completely,
so this shouldn't matter.
2020-12-18 09:54:11 -08:00
Jeremy Evans 52fb696ee7 Switch rb_category_warn{,ing} to accept an rb_warning_category_t
Since we decided to only allowing specific warning categories,
there is no reason to have an API that accepts a general string,
as it is more error-prone.  Switch to only allowing the specific
warning categories.

As rb_category_warn{,ing} are public API, this requires making
rb_warning_category_t public API as well.
2020-12-18 09:54:11 -08:00