Age | Commit message (Collapse) | Author |
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3889
|
|
Now we require C99, these features available of course.
* prototypes
* stdarg prototypes
* token pasting
* stringization
* string literal concatenation
Notes:
Merged: https://github.com/ruby/ruby/pull/3889
|
|
As well as 2366c681166a1dab95de6b9ca8ffcaae18aadd39.
|
|
rb_memory_view_prepare_item_desc
|
|
|
|
rb_memory_view_prepare_item_desc (#3871)
Notes:
Merged-By: mrkn <mrkn@ruby-lang.org>
|
|
* 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.
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3853
|
|
Notes:
Merged-By: mrkn <mrkn@ruby-lang.org>
|
|
* 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.
Notes:
Merged-By: nurse <naruse@airemix.jp>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3841
|
|
Follow N2328 http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2328.pdf
|
|
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]
|
|
This reverts the following three commits.
- ce707079c153f389d861c91a8dccc510fab0e245
- 1a76bb56b0ba99a19d1373c4c8ebac42e7b6f27c
- 51500eedefa492699668ced3e07e330a9a4d53ee
|
|
|
|
|
|
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().
|
|
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]
|
|
|
|
Thought it was not a bad idea to document these CAPI. [ci skip]
|
|
This API in fact pins objects passed to it. See vm.c:2546.
Notes:
Merged: https://github.com/ruby/ruby/pull/3815
|
|
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]
Notes:
Merged: https://github.com/ruby/ruby/pull/3824
|
|
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.
Notes:
Merged: https://github.com/ruby/ruby/pull/3822
|
|
* 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
Notes:
Merged-By: mrkn <mrkn@ruby-lang.org>
|
|
|
|
instead of 'do not call it directly.' comment.
|
|
To make some kind of Ractor related extensions, some functions
should be exposed.
* include/ruby/thread_native.h
* rb_native_mutex_*
* rb_native_cond_*
* include/ruby/ractor.h
* RB_OBJ_SHAREABLE_P(obj)
* rb_ractor_shareable_p(obj)
* rb_ractor_std*()
* rb_cRactor
and rm ractor_pub.h
and rename srcdir/ractor.h to srcdir/ractor_core.h
(to avoid conflict with include/ruby/ractor.h)
Notes:
Merged: https://github.com/ruby/ruby/pull/3775
|
|
Fixes [Feature #13381]
Notes:
Merged: https://github.com/ruby/ruby/pull/3586
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3733
|
|
Many functions in string.c assume that capa + termlen to be readable
memory. Add comment in header to communicate this to extension authors.
See also: comment in str_fill_term()
Notes:
Merged: https://github.com/ruby/ruby/pull/3698
|
|
Introduce new method Ractor.make_shareable(obj) which tries to make
obj shareable object. Protocol is here.
(1) If obj is shareable, it is shareable.
(2) If obj is not a shareable object and if obj can be shareable
object if it is frozen, then freeze obj. If obj has reachable
objects (rs), do rs.each{|o| Ractor.make_shareable(o)}
recursively (recursion is not Ruby-level, but C-level).
(3) Otherwise, raise Ractor::Error. Now T_DATA is not a shareable
object even if the object is frozen.
If the method finished without error, given obj is marked as
a sharable object.
To allow makng a shareable frozen T_DATA object, then set
`RUBY_TYPED_FROZEN_SHAREABLE` as type->flags. On default,
this flag is not set. It means user defined T_DATA objects are
not allowed to become shareable objects when it is frozen.
You can make any object shareable by setting FL_SHAREABLE flag,
so if you know that the T_DATA object is shareable (== thread-safe),
set this flag, at creation time for example. `Ractor` object is one
example, which is not a frozen, but a shareable object.
Notes:
Merged: https://github.com/ruby/ruby/pull/3678
|
|
* Support ArithmeticSequence in Array#slice
* Extract rb_range_component_beg_len
* Use rb_range_values to check Range object
* Fix ary_make_partial_step
* Fix for negative step cases
* range.c: Describe the role of err argument in rb_range_component_beg_len
* Raise a RangeError when an arithmetic sequence refers the outside of an array
[Feature #16812]
Notes:
Merged-By: mrkn <mrkn@ruby-lang.org>
|
|
(1) nobody uses it (gem-codesearch)
(2) the data strucuture will be changed.
Notes:
Merged: https://github.com/ruby/ruby/pull/3662
|
|
This reverts commit c839168b1141db53bedef771d1bc78908b6ac782.
`rb_callable_receiver` does not need to be exposed under include.
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3629
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3631
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3631
|
|
Because `bool` is already used in the header there is no reason to
hesitate.
Notes:
Merged: https://github.com/ruby/ruby/pull/3631
|
|
Bit readable to me.
Notes:
Merged: https://github.com/ruby/ruby/pull/3631
|
|
This adds more room for assertions.
Notes:
Merged: https://github.com/ruby/ruby/pull/3631
|
|
cf: https://github.com/ruby/ruby/pull/2991/commits/99add258571bf103c6d942bf0e4d510763b73918
Notes:
Merged: https://github.com/ruby/ruby/pull/3631
|
|
|
|
* memory_view.c: Use ssize_t for ndim in memory_view
* include/ruby/memory_view.h: Fix the type of item_size argument
Notes:
Merged-By: mrkn <mrkn@ruby-lang.org>
|
|
Reported by Mau Magnaguagno See: https://github.com/ruby/ruby/pull/3570#discussion_r495465903
|
|
This adds the following C-API functions that can be used to emit
warnings with categories included:
```c
void rb_category_warn(const char *, const char*, ...)
void rb_category_warning(const char*, const char*, ...)
```
Internally in error.c, there is an rb_warn_category function
that will call Warning.warn with the string and the category
keyword if it doesn't have an arity of 1, and will call
Warning.warn with just the string if it has an arity of 1.
This refactors the rb_warn_deprecated{,_to_remove} functions
to use rb_warn_category.
This makes Kernel#warn accept a category keyword and pass it
to Warning.warn, so that Ruby methods can more easily emit
warnings with categories. rb_warn_category makes sure that
the passed category is a already defined category symbol
before calling Warning.warn.
The only currently defined warning category is :deprecated,
since that is what is already used. More categories can be
added in later commits.
Notes:
Merged: https://github.com/ruby/ruby/pull/3508
|
|
Since r63443, `-std=gnu99 -D_XOPEN_SOUCE=x00` is added to Solaris'
`CPPFLAGS`. `CPPFLAGS` is shared among `CC` / `CXX`. This results in
both `__STDC_VERSION__` and `__cplusplus` to be defined at the same time
for a C++ compilation, only on Solaris.
It seems the `CPPFLAGS` addition is intentional. We sould not touch
that part. Instead we need to reroute this by always check for
`__cplusplus` first.
|
|
|
|
* Add buffer protocol
* Modify for some review comments
* Per-object buffer availability
* Rename to MemoryView from Buffer and make compilable
* Support integral repeat count in memory view format
* Support 'x' for padding bytes
* Add rb_memory_view_parse_item_format
* Check type in rb_memory_view_register
* Update dependencies in common.mk
* Add test of MemoryView
* Add test of rb_memory_view_init_as_byte_array
* Add native size format test
* Add MemoryView test utilities
* Add test of rb_memory_view_fill_contiguous_strides
* Skip spaces in format string
* Support endianness specifiers
* Update documentation
* Support alignment
* Use RUBY_ALIGNOF
* Fix format parser to follow the pack format
* Support the _ modifier
* Parse count specifiers in get_format_size function.
* Use STRUCT_ALIGNOF
* Fix test
* Fix test
* Fix total size for the case with tail padding
* Fix rb_memory_view_get_item_pointer
* Fix rb_memory_view_parse_item_format again
Notes:
Merged-By: mrkn <mrkn@ruby-lang.org>
|
|
Now taint flag is obsolete and it is used fro shareaable flag.
So we should not check this flag.
Notes:
Merged: https://github.com/ruby/ruby/pull/3575
|