mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 20:19:19 +00:00
fix typo s/sharable/shareable/
This commit is contained in:
parent
5062c0c621
commit
2aaea665bb
Notes:
git
2025-12-04 18:11:19 +00:00
@ -1203,9 +1203,9 @@ assert_equal '[:ok, "Proc\'s self is not shareable:"]', %q{
|
||||
end
|
||||
}
|
||||
|
||||
# Ractor.make_sharable(Method/UnboundMethod)
|
||||
# Ractor.make_shareable(Method/UnboundMethod)
|
||||
assert_equal 'true', %q{
|
||||
# raise because receiver is unsharable
|
||||
# raise because receiver is unshareable
|
||||
begin
|
||||
_m0 = Ractor.make_shareable(self.method(:__id__))
|
||||
rescue => e
|
||||
@ -1214,7 +1214,7 @@ assert_equal 'true', %q{
|
||||
raise "no error"
|
||||
end
|
||||
|
||||
# Method with sharable receiver
|
||||
# Method with shareable receiver
|
||||
M1 = Ractor.make_shareable(Object.method(:__id__))
|
||||
|
||||
# UnboundMethod
|
||||
|
||||
@ -170,7 +170,7 @@ In this mode, all values assigned to constants are made shareable.
|
||||
|
||||
# shareable_constant_value: experimental_everything
|
||||
FOO = Set[1, 2, {foo: []}]
|
||||
# same as FOO = Ractor.make_sharable(...)
|
||||
# same as FOO = Ractor.make_shareable(...)
|
||||
# OR same as `FOO = Set[1, 2, {foo: [].freeze}.freeze].freeze`
|
||||
|
||||
var = [{foo: []}]
|
||||
|
||||
@ -160,7 +160,7 @@ rbimpl_typeddata_flags {
|
||||
// experimental flag
|
||||
// Similar to RUBY_TYPED_FROZEN_SHAREABLE, but doesn't make shareable
|
||||
// reachable objects from this T_DATA object on the Ractor.make_shareable.
|
||||
// If it refers to unsharable objects, simply raise an error.
|
||||
// If it refers to unshareable objects, simply raise an error.
|
||||
// RUBY_TYPED_FROZEN_SHAREABLE_NO_REC = RUBY_FL_FINALIZE,
|
||||
|
||||
/**
|
||||
|
||||
@ -217,7 +217,7 @@ VALUE rb_ractor_make_shareable(VALUE obj);
|
||||
*
|
||||
* @param[in] obj Arbitrary ruby object to duplicate.
|
||||
* @exception rb_eRactorError Ractors cannot share `obj` by nature.
|
||||
* @return A deep copy of `obj` which is sharable among Ractors.
|
||||
* @return A deep copy of `obj` which is shareable among Ractors.
|
||||
*/
|
||||
VALUE rb_ractor_make_shareable_copy(VALUE obj);
|
||||
|
||||
|
||||
2
ractor.c
2
ractor.c
@ -2366,7 +2366,7 @@ ractor_local_value_store_if_absent(rb_execution_context_t *ec, VALUE self, VALUE
|
||||
return rb_mutex_synchronize(cr->local_storage_store_lock, ractor_local_value_store_i, (VALUE)&data);
|
||||
}
|
||||
|
||||
// sharable_proc
|
||||
// shareable_proc
|
||||
|
||||
static VALUE
|
||||
ractor_shareable_proc(rb_execution_context_t *ec, VALUE replace_self, bool is_lambda)
|
||||
|
||||
@ -607,7 +607,7 @@ class Ractor
|
||||
|
||||
#
|
||||
# call-seq:
|
||||
# Ractor.sharable_proc(self: nil){} -> sharable proc
|
||||
# Ractor.shareable_proc(self: nil){} -> shareable proc
|
||||
#
|
||||
# It returns shareable Proc object. The Proc object is
|
||||
# shareable and the self in a block will be replaced with
|
||||
@ -619,7 +619,7 @@ class Ractor
|
||||
# Ractor.shareable_proc{ p a }
|
||||
# #=> can not isolate a Proc because it accesses outer variables (a). (ArgumentError)
|
||||
#
|
||||
# The `self` should be a sharable object
|
||||
# The `self` should be a shareable object
|
||||
#
|
||||
# Ractor.shareable_proc(self: self){}
|
||||
# #=> self should be shareable: main (Ractor::IsolationError)
|
||||
@ -634,9 +634,9 @@ class Ractor
|
||||
|
||||
#
|
||||
# call-seq:
|
||||
# Ractor.sharable_proc{} -> sharable proc
|
||||
# Ractor.shareable_proc{} -> shareable proc
|
||||
#
|
||||
# Same as Ractor.sharable_proc, but returns lambda proc.
|
||||
# Same as Ractor.shareable_proc, but returns lambda proc.
|
||||
#
|
||||
def self.shareable_lambda self: nil
|
||||
Primitive.attr! :use_block
|
||||
|
||||
@ -1544,7 +1544,7 @@ x = __ENCODING__
|
||||
end
|
||||
|
||||
def test_shareable_constant_value_simple
|
||||
obj = [['unsharable_value']]
|
||||
obj = [['unshareable_value']]
|
||||
a, b, c = eval_separately("#{<<~"begin;"}\n#{<<~'end;'}")
|
||||
begin;
|
||||
# shareable_constant_value: experimental_everything
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user