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

1771 Коммитов

Автор SHA1 Сообщение Дата
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
Kenta Murata 51500eedef
memory_view.c: Add rb_memory_view_extract_item_members 2020-12-06 22:46:06 +09:00
Masaki Matsushita 76439eee68 Call cleanup function for getaddrinfo_a(3) only before fork()
Previously, rb_getaddrinfo_a_before_exec() is called from before_exec().
However, the function needs to be called only before fork().
The change moves it to before_fork().
2020-12-06 01:32:43 +09:00
Masaki Matsushita 94d49ed31c Add a hook before fork() for getaddrinfo_a()
We need stop worker threads in getaddrinfo_a() before fork().
This change adds a hook before fork() that cancel all outstanding requests
and wait for all ongoing requests. Then, it waits for all worker
threads to be finished.

Fixes [Bug #17220]
2020-12-04 23:31:51 +09:00
Kazuhiro NISHIYAMA 94b2323a68
Fix typos [ci skip] 2020-12-04 10:37:58 +09:00
卜部昌平 84eb2bfab9 include/ruby/internal/xmalloc.h: add doxygen
Thought it was not a bad idea to document these CAPI. [ci skip]
2020-12-03 12:07:56 +09:00
Alan Wu 56141d38a3 Fix docs about movement for rb_gc_register_mark_object()
This API in fact pins objects passed to it. See vm.c:2546.
2020-12-01 15:23:09 -05:00
Koichi Sasada 182fb73c40 rb_ext_ractor_safe() to declare ractor-safe ext
C extensions can violate the ractor-safety, so only ractor-safe
C extensions (C methods) can run on non-main ractors.
rb_ext_ractor_safe(true) declares that the successive
defined methods are ractor-safe. Otherwiwze, defined methods
checked they are invoked in main ractor and raise an error
if invoked at non-main ractors.

[Feature #17307]
2020-12-01 15:44:18 +09:00
Koichi Sasada 67693d8d80 ractor local storage C-API
To manage ractor-local data for C extension, the following APIs
are defined.

* rb_ractor_local_storage_value_newkey
* rb_ractor_local_storage_value
* rb_ractor_local_storage_value_set
* rb_ractor_local_storage_ptr_newkey
* rb_ractor_local_storage_ptr
* rb_ractor_local_storage_ptr_set

At first, you need to create a key of storage by
rb_ractor_local_(value|ptr)_newkey().
For ptr storage, it accepts the type of storage,
how to mark and how to free with ractor's lifetime.

rb_ractor_local_storage_value/set are used to access a VALUE
and rb_ractor_local_storage_ptr/set are used to access a pointer.

random.c uses this API.
2020-12-01 09:39:30 +09:00
Kenta Murata 73a337e214
Keep references of memory-view-exported objects (#3816)
* memory_view.c: remove a reference in view->obj at rb_memory_view_release

* memory_view.c: keep references of memory-view-exported objects

* Update common.mk

* memory_view.c: Use st_update
2020-11-30 14:53:13 +09:00