summaryrefslogtreecommitdiff
path: root/include/ruby
Commit message (Collapse)AuthorAgeFilesLines
* merge revision(s) 29f6f79e7396018962eb25c5f5e409f5fe28a73b: [Backport ↵nagachika2022-03-131-0/+2
| | | | | | | | | | | #17788] [Backport #18574] Get `ruby_nonempty_memcpy` to have C linkage Fixes [Bug #17788] --- include/ruby/internal/memory.h | 2 ++ 1 file changed, 2 insertions(+)
* merge revision(s) bcc2bb28b04054106f4a36e8fd69b2af6ecb033a: [Backport #18500]nagachika2022-03-121-3/+3
| | | | | | | | | | Fix stack buffer overflow https://hackerone.com/reports/1306859 --- include/ruby/internal/memory.h | 6 +++--- random.c | 7 ++----- 2 files changed, 5 insertions(+), 8 deletions(-)
* merge revision(s) ecb2ff60507a41c624f59cb9da6a008ab3ec36e1: [Backport #18403]nagachika2022-03-121-1/+1
| | | | | | | | | intern/select/posix.h: remove unused parameter from rb_fd_dup This unused parameter seems to be accidently introduced by https://github.com/ruby/ruby/commit/9e6e39c --- include/ruby/internal/intern/select/posix.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
* Fixed a typo [Bug #17522]Tee KOBAYASHI2021-01-131-1/+1
|
* Fixed dangling imemo_tmpbufNobuyoshi Nakada2021-01-131-2/+3
| | | | | | | | 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>
* expose some C-APIs for ractorKoichi Sasada2021-01-131-3/+4
| | | | | | | | | | | | | 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)
* Use RBIMPL_COMPILER_{SINCE,BEFORE} for MSVCNobuyoshi Nakada2020-12-241-3/+3
| | | | | | | | 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.
* shareable_constant_value: experimental_copyKoichi Sasada2020-12-241-0/+3
| | | | | | | "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.
* Expose atomic operation macros with RUBY prefixNobuyoshi Nakada2020-12-241-0/+236
| | | | | Now we need atomic operations, which are lighter than mutex, more widely for extension libraries because of Ractor.
* [memory_view] Fix some grammar issues in a commentKenta Murata2020-12-241-4/+4
|
* [memory_view] Make some rb_memroy_view_t members constKenta Murata2020-12-231-4/+4
|
* [memory_view][fiddle] Rename len to byte_size in rb_memory_view_tKenta Murata2020-12-231-1/+1
|
* [memory_view][fiddle] Use bool for boolean return valueKenta Murata2020-12-231-8/+8
|
* rb_cCont: no longer exists卜部昌平2020-12-221-1/+0
| | | | Deleted well over a decade ago in commit 977d66ec993b0f1892fb3e4cd8ac.
* Removed rb_cData entityNobuyoshi Nakada2020-12-222-3/+10
| | | | | | | * 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
* Data: delete卜部昌平2020-12-221-0/+2
| | | | | | | | Has been deprecated since 684bdf6171b76f5bc5e4f05926a5ab01ec2b4fd5. 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.
* include/ruby/internal/xmalloc.h: document rb_eNoMemError卜部昌平2020-12-211-42/+43
| | | | | It was my bad, the exception that actually raises is rb_eNoMemError. [ci skip]
* include/ruby/internal/xmalloc.h: doxygen tag卜部昌平2020-12-211-8/+8
| | | | | `@exception` is an alias of `@throw`. It might suite Ruby's document because ruby uses `raise` terminology instead of `throw`. [ci skip]
* win32: Deprecate file CP version functionsNobuyoshi Nakada2020-12-202-21/+22
|
* win32: Use UTF-8 as filesystem encoding [Feature #12654]Nobuyoshi Nakada2020-12-201-17/+14
| | | | Co-Authored-By: Dāvis Mosāns <davispuh@gmail.com>
* Use category: :experimental in warnings that are related to experimental ↵Jeremy Evans2020-12-181-2/+3
| | | | | | | | | 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.
* Switch rb_category_warn{,ing} to accept an rb_warning_category_tJeremy Evans2020-12-181-2/+9
| | | | | | | | | | 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.
* ruby_set_stack_size: no longer exists卜部昌平2020-12-181-1/+0
| | | | Deleted since fc3c60f6081d85f6274986a7a08b59db1515fcb5
* add HAVE_RB_EXT_RACTOR_SAFE macroKoichi Sasada2020-12-171-0/+1
| | | | | define HAVE_RB_EXT_RACTOR_SAFE to check rb_ext_ractor_safe() is available or not.
* Made LARGEFILE_SUPPORT mandatoryNobuyoshi Nakada2020-12-161-7/+0
|
* Removed stale declarationNobuyoshi Nakada2020-12-161-1/+0
| | | | | rb_w32_pipe_exec was removed in 1.9.3, at commit:7ac32d7a16734ea66de15319bcff2fd429abae7f.
* Signal handler type should be voidNobuyoshi Nakada2020-12-121-2/+1
|
* Omit checks for C89 standard or laterNobuyoshi Nakada2020-12-121-6/+9
| | | | | | | | | | Now we require C99, these features available of course. * prototypes * stdarg prototypes * token pasting * stringization * string literal concatenation
* Added parentheses to silence sizeof-array-div warnings [Bug #17385]Nobuyoshi Nakada2020-12-121-1/+1
| | | | As well as 2366c681166a1dab95de6b9ca8ffcaae18aadd39.
* include/ruby/memory_view.h: fix the return type of ↵Kenta Murata2020-12-101-1/+1
| | | | rb_memory_view_prepare_item_desc
* include/ruby/memory_view.h: fix typoKenta Murata2020-12-101-1/+1
|
* memory_view.c: Add rb_memory_view_get_item and ↵Kenta Murata2020-12-101-2/+6
| | | | rb_memory_view_prepare_item_desc (#3871)
* Tweaked `Process::Status.wait`Nobuyoshi Nakada2020-12-091-1/+1
| | | | | | | | * 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.
* Removed declaration of non-existent symbolNobuyoshi Nakada2020-12-091-2/+0
|
* Add support for non-blocking `Process.wait`.Samuel Williams2020-12-091-1/+3
|
* memory_view.c: Add rb_memory_view_extract_item_members (#3855)Kenta Murata2020-12-081-1/+2
|
* Windows: Read ENV names and values as UTF-8 encoded Strings (#3818)Lars Kanis2020-12-081-2/+2
| | | | | | | | | | | | | | | | | | | | | * 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.
* Removed deprecated Time#succNobuyoshi Nakada2020-12-071-1/+0
|
* Doxygen terminology update [ci skip]卜部昌平2020-12-071-12/+12
| | | | Follow N2328 http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2328.pdf
* Revert getaddrinfo_a()Masaki Matsushita2020-12-071-2/+0
| | | | | | | | 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]
* Revert "memory_view.c: Add rb_memory_view_extract_item_members"Kenta Murata2020-12-071-2/+1
| | | | | | | | This reverts the following three commits. - ce707079c153f389d861c91a8dccc510fab0e245 - 1a76bb56b0ba99a19d1373c4c8ebac42e7b6f27c - 51500eedefa492699668ced3e07e330a9a4d53ee
* memory_view.c: Fix the argument type of rb_memory_view_extract_item_membersKenta Murata2020-12-061-1/+1
|
* memory_view.c: Add rb_memory_view_extract_item_membersKenta Murata2020-12-061-1/+2
|
* Call cleanup function for getaddrinfo_a(3) only before fork()Masaki Matsushita2020-12-061-1/+1
| | | | | | 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().
* Add a hook before fork() for getaddrinfo_a()Masaki Matsushita2020-12-041-0/+2
| | | | | | | | | 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]
* Fix typos [ci skip]Kazuhiro NISHIYAMA2020-12-041-3/+3
|
* include/ruby/internal/xmalloc.h: add doxygen卜部昌平2020-12-031-0/+160
| | | | Thought it was not a bad idea to document these CAPI. [ci skip]
* Fix docs about movement for rb_gc_register_mark_object()Alan Wu2020-12-011-4/+2
| | | | This API in fact pins objects passed to it. See vm.c:2546.
* rb_ext_ractor_safe() to declare ractor-safe extKoichi Sasada2020-12-011-0/+4
| | | | | | | | | | | 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]
* ractor local storage C-APIKoichi Sasada2020-12-011-0/+19
| | | | | | | | | | | | | | | | | | | | | | 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.