Commit graph

2180 commits

Author SHA1 Message Date
卜部昌平
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
卜部昌平
aa82b067cb ruby_set_stack_size: no longer exists
Deleted since fc3c60f608
2020-12-18 11:18:09 +09:00
Koichi Sasada
b29c0fadec add HAVE_RB_EXT_RACTOR_SAFE macro
define HAVE_RB_EXT_RACTOR_SAFE to check rb_ext_ractor_safe() is
available or not.
2020-12-17 00:29:48 +09:00
Nobuyoshi Nakada
ddb93c3d64 Made LARGEFILE_SUPPORT mandatory 2020-12-16 19:10:37 +09:00
Nobuyoshi Nakada
5193fbb6d0 Removed stale declaration
rb_w32_pipe_exec was removed in 1.9.3, at
commit:7ac32d7a16734ea66de15319bcff2fd429abae7f.
2020-12-16 19:10:37 +09:00
Nobuyoshi Nakada
0df67a4695 Signal handler type should be void 2020-12-12 17:02:42 +09:00
Nobuyoshi Nakada
21c5726418 Omit checks for C89 standard or later
Now we require C99, these features available of course.

* prototypes
* stdarg prototypes
* token pasting
* stringization
* string literal concatenation
2020-12-12 17:02:42 +09:00
Nobuyoshi Nakada
68af523529
Added parentheses to silence sizeof-array-div warnings [Bug #17385]
As well as 2366c68116.
2020-12-12 14:25:30 +09:00
Kenta Murata
73db60bdda
include/ruby/memory_view.h: fix the return type of rb_memory_view_prepare_item_desc 2020-12-10 21:41:47 +09:00
Kenta Murata
0fcd478a4e
include/ruby/memory_view.h: fix typo 2020-12-10 21:35:53 +09:00
Kenta Murata
bb489aca58
memory_view.c: Add rb_memory_view_get_item and rb_memory_view_prepare_item_desc (#3871) 2020-12-10 00:24:36 +09:00
Nobuyoshi Nakada
b419f90a8b
Tweaked Process::Status.wait
* revert `rb_last_status_set`
* renamed the new function as `rb_process_status_new`
* `rb_process_status_new` always freezes the return value
* marked `Process::Status.wait` as EXPERIMENTAL, as it has not
  been discussed totally yet.
2020-12-09 11:51:57 +09:00
Nobuyoshi Nakada
4f907a80f0
Removed declaration of non-existent symbol 2020-12-09 11:32:18 +09:00
Samuel Williams
2553c5f94a Add support for non-blocking Process.wait. 2020-12-09 08:55:35 +13:00
Kenta Murata
7e69296a2b
memory_view.c: Add rb_memory_view_extract_item_members (#3855) 2020-12-08 02:01:31 +09:00
Lars Kanis
ca76337a00
Windows: Read ENV names and values as UTF-8 encoded Strings (#3818)
* Windows: Read ENV names and values as UTF-8 encoded Strings

Implements issue #12650: fix https://bugs.ruby-lang.org/issues/12650

This also removes the special encoding for ENV['PATH'] and some
complexity in the code that is unnecessary now.

* Windows: Improve readablity of getenv() encoding

getenv() did use the expected codepage as an implicit parameter of the macro.
This is mis-leading since include/ruby/win32.h has a different definition.
Using the "cp" variable explicit (like the other function calls) makes it
more readable and consistent.

* Windows: Change external C-API macros getenv() and execv() to use UTF-8

They used to process and return strings with locale encoding,
but since all ruby-internal spawn and environment functions use UTF-8,
it makes sense to change the C-API equally.
2020-12-08 02:00:39 +09:00
Nobuyoshi Nakada
7817a438eb Removed deprecated Time#succ 2020-12-07 18:38:59 +09:00
卜部昌平
cc36e499f9 Doxygen terminology update [ci skip]
Follow N2328 http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2328.pdf
2020-12-07 14:20:44 +09:00
Masaki Matsushita
5d8bcc4870 Revert getaddrinfo_a()
getaddrinfo_a() gets stuck after fork().
To avoid this, we need 1 second sleep to wait for internal
worker threads of getaddrinfo_a() to be finished, but that is unacceptable.

[Bug #17220] [Feature #17134] [Feature #17187]
2020-12-07 13:33:53 +09:00
Kenta Murata
60eabb1aa7
Revert "memory_view.c: Add rb_memory_view_extract_item_members"
This reverts the following three commits.

- ce707079c1
- 1a76bb56b0
- 51500eedef
2020-12-07 00:38:19 +09:00
Kenta Murata
1a76bb56b0
memory_view.c: Fix the argument type of rb_memory_view_extract_item_members 2020-12-06 23:24:45 +09:00