rbs 3.10.0.pre.2 → 3.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/c-check.yml +1 -1
- data/.github/workflows/comments.yml +3 -3
- data/.github/workflows/ruby.yml +7 -8
- data/CHANGELOG.md +60 -0
- data/core/array.rbs +52 -3
- data/core/comparable.rbs +13 -6
- data/core/complex.rbs +40 -25
- data/core/dir.rbs +2 -2
- data/core/encoding.rbs +3 -7
- data/core/enumerable.rbs +1 -1
- data/core/enumerator.rbs +43 -1
- data/core/fiber.rbs +26 -17
- data/core/file.rbs +23 -8
- data/core/file_test.rbs +1 -1
- data/core/float.rbs +223 -32
- data/core/gc.rbs +4 -9
- data/core/hash.rbs +9 -10
- data/core/integer.rbs +104 -63
- data/core/io/buffer.rbs +21 -10
- data/core/io.rbs +8 -8
- data/core/kernel.rbs +12 -8
- data/core/method.rbs +49 -19
- data/core/module.rbs +30 -12
- data/core/numeric.rbs +17 -9
- data/core/object_space.rbs +13 -20
- data/core/pathname.rbs +2 -37
- data/core/proc.rbs +15 -16
- data/core/ractor.rbs +156 -145
- data/core/range.rbs +1 -1
- data/core/rational.rbs +56 -34
- data/core/rbs/unnamed/argf.rbs +1 -1
- data/core/regexp.rbs +3 -3
- data/core/ruby.rbs +53 -0
- data/core/rubygems/version.rbs +2 -3
- data/core/set.rbs +88 -66
- data/core/signal.rbs +24 -14
- data/core/string.rbs +304 -166
- data/core/symbol.rbs +13 -7
- data/core/thread.rbs +12 -13
- data/core/trace_point.rbs +7 -4
- data/lib/rbs/collection/config/lockfile_generator.rb +7 -0
- data/lib/rbs/environment_loader.rb +0 -6
- data/lib/rbs/subtractor.rb +3 -1
- data/lib/rbs/test/type_check.rb +1 -0
- data/lib/rbs/version.rb +1 -1
- data/lib/rdoc/discover.rb +1 -1
- data/stdlib/bigdecimal/0/big_decimal.rbs +100 -82
- data/stdlib/bigdecimal-math/0/big_math.rbs +169 -8
- data/stdlib/cgi/0/core.rbs +11 -1
- data/stdlib/cgi-escape/0/escape.rbs +33 -15
- data/stdlib/date/0/date.rbs +67 -59
- data/stdlib/date/0/date_time.rbs +1 -1
- data/stdlib/json/0/json.rbs +1 -0
- data/stdlib/objspace/0/objspace.rbs +1 -1
- data/stdlib/openssl/0/openssl.rbs +150 -80
- data/stdlib/pathname/0/pathname.rbs +36 -0
- data/stdlib/psych/0/psych.rbs +3 -3
- data/stdlib/stringio/0/stringio.rbs +796 -37
- data/stdlib/strscan/0/string_scanner.rbs +1 -1
- data/stdlib/tempfile/0/tempfile.rbs +2 -2
- data/stdlib/time/0/time.rbs +1 -1
- data/stdlib/timeout/0/timeout.rbs +63 -7
- data/stdlib/uri/0/generic.rbs +1 -1
- metadata +4 -2
data/core/float.rbs
CHANGED
|
@@ -1,15 +1,193 @@
|
|
|
1
|
-
# <!-- rdoc-file=
|
|
2
|
-
# A Float object
|
|
3
|
-
#
|
|
1
|
+
# <!-- rdoc-file=float.rb -->
|
|
2
|
+
# A Float object stores a real number using the native architecture's
|
|
3
|
+
# double-precision floating-point representation.
|
|
4
|
+
#
|
|
5
|
+
# ## Float Imprecisions
|
|
6
|
+
#
|
|
7
|
+
# Some real numbers can be represented precisely as Float objects:
|
|
8
|
+
#
|
|
9
|
+
# 37.5 # => 37.5
|
|
10
|
+
# 98.75 # => 98.75
|
|
11
|
+
# 12.3125 # => 12.3125
|
|
12
|
+
#
|
|
13
|
+
# Others cannot; among these are the transcendental numbers, including:
|
|
14
|
+
#
|
|
15
|
+
# * Pi, *π*: in mathematics, a number of infinite precision:
|
|
16
|
+
# 3.1415926535897932384626433... (to 25 places); in Ruby, it is of limited
|
|
17
|
+
# precision (in this case, to 16 decimal places):
|
|
18
|
+
#
|
|
19
|
+
# Math::PI # => 3.141592653589793
|
|
20
|
+
#
|
|
21
|
+
# * Euler's number, *e*: in mathematics, a number of infinite precision:
|
|
22
|
+
# 2.7182818284590452353602874... (to 25 places); in Ruby, it is of limited
|
|
23
|
+
# precision (in this case, to 15 decimal places):
|
|
24
|
+
#
|
|
25
|
+
# Math::E # => 2.718281828459045
|
|
26
|
+
#
|
|
27
|
+
# Some floating-point computations in Ruby give precise results:
|
|
28
|
+
#
|
|
29
|
+
# 1.0/2 # => 0.5
|
|
30
|
+
# 100.0/8 # => 12.5
|
|
31
|
+
#
|
|
32
|
+
# Others do not:
|
|
33
|
+
#
|
|
34
|
+
# * In mathematics, 2/3 as a decimal number is an infinitely-repeating
|
|
35
|
+
# decimal: 0.666... (forever); in Ruby, `2.0/3` is of limited precision (in
|
|
36
|
+
# this case, to 16 decimal places):
|
|
37
|
+
#
|
|
38
|
+
# 2.0/3 # => 0.6666666666666666
|
|
39
|
+
#
|
|
40
|
+
# * In mathematics, the square root of 2 is an irrational number of infinite
|
|
41
|
+
# precision: 1.4142135623730950488016887... (to 25 decimal places); in Ruby,
|
|
42
|
+
# it is of limited precision (in this case, to 16 decimal places):
|
|
43
|
+
#
|
|
44
|
+
# Math.sqrt(2.0) # => 1.4142135623730951
|
|
45
|
+
#
|
|
46
|
+
# * Even a simple computation can introduce imprecision:
|
|
47
|
+
#
|
|
48
|
+
# x = 0.1 + 0.2 # => 0.30000000000000004
|
|
49
|
+
# y = 0.3 # => 0.3
|
|
50
|
+
# x == y # => false
|
|
51
|
+
#
|
|
52
|
+
# See:
|
|
53
|
+
#
|
|
54
|
+
# * https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
|
|
55
|
+
# * https://github.com/rdp/ruby_tutorials_core/wiki/Ruby-Talk-FAQ#-why-are-rub
|
|
56
|
+
# ys-floats-imprecise
|
|
57
|
+
# * https://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
|
|
58
|
+
#
|
|
59
|
+
# Note that precise storage and computation of rational numbers is possible
|
|
60
|
+
# using Rational objects.
|
|
61
|
+
#
|
|
62
|
+
# ## Creating a Float
|
|
63
|
+
#
|
|
64
|
+
# You can create a Float object explicitly with:
|
|
65
|
+
#
|
|
66
|
+
# * A [floating-point literal](rdoc-ref:syntax/literals.rdoc@Float+Literals).
|
|
67
|
+
#
|
|
68
|
+
# You can convert certain objects to Floats with:
|
|
69
|
+
#
|
|
70
|
+
# * Method #Float.
|
|
71
|
+
#
|
|
72
|
+
# ## What's Here
|
|
73
|
+
#
|
|
74
|
+
# First, what's elsewhere. Class Float:
|
|
75
|
+
#
|
|
76
|
+
# * Inherits from [class Numeric](rdoc-ref:Numeric@What-27s+Here) and [class
|
|
77
|
+
# Object](rdoc-ref:Object@What-27s+Here).
|
|
78
|
+
# * Includes [module Comparable](rdoc-ref:Comparable@What-27s+Here).
|
|
79
|
+
#
|
|
80
|
+
# Here, class Float provides methods for:
|
|
81
|
+
#
|
|
82
|
+
# * [Querying](rdoc-ref:Float@Querying)
|
|
83
|
+
# * [Comparing](rdoc-ref:Float@Comparing)
|
|
84
|
+
# * [Converting](rdoc-ref:Float@Converting)
|
|
85
|
+
#
|
|
86
|
+
# ### Querying
|
|
87
|
+
#
|
|
88
|
+
# * #finite?: Returns whether `self` is finite.
|
|
89
|
+
# * #hash: Returns the integer hash code for `self`.
|
|
90
|
+
# * #infinite?: Returns whether `self` is infinite.
|
|
91
|
+
# * #nan?: Returns whether `self` is a NaN (not-a-number).
|
|
92
|
+
#
|
|
93
|
+
# ### Comparing
|
|
94
|
+
#
|
|
95
|
+
# * #<: Returns whether `self` is less than the given value.
|
|
96
|
+
# * #<=: Returns whether `self` is less than or equal to the given value.
|
|
97
|
+
# * #<=>: Returns a number indicating whether `self` is less than, equal to,
|
|
98
|
+
# or greater than the given value.
|
|
99
|
+
# * #== (aliased as #=== and #eql?): Returns whether `self` is equal to the
|
|
100
|
+
# given value.
|
|
101
|
+
# * #>: Returns whether `self` is greater than the given value.
|
|
102
|
+
# * #>=: Returns whether `self` is greater than or equal to the given value.
|
|
103
|
+
#
|
|
104
|
+
# ### Converting
|
|
105
|
+
#
|
|
106
|
+
# * #% (aliased as #modulo): Returns `self` modulo the given value.
|
|
107
|
+
# * #*: Returns the product of `self` and the given value.
|
|
108
|
+
# * #**: Returns the value of `self` raised to the power of the given value.
|
|
109
|
+
# * #+: Returns the sum of `self` and the given value.
|
|
110
|
+
# * #-: Returns the difference of `self` and the given value.
|
|
111
|
+
# * #/: Returns the quotient of `self` and the given value.
|
|
112
|
+
# * #ceil: Returns the smallest number greater than or equal to `self`.
|
|
113
|
+
# * #coerce: Returns a 2-element array containing the given value converted to
|
|
114
|
+
# a Float and `self`
|
|
115
|
+
# * #divmod: Returns a 2-element array containing the quotient and remainder
|
|
116
|
+
# results of dividing `self` by the given value.
|
|
117
|
+
# * #fdiv: Returns the Float result of dividing `self` by the given value.
|
|
118
|
+
# * #floor: Returns the greatest number smaller than or equal to `self`.
|
|
119
|
+
# * #next_float: Returns the next-larger representable Float.
|
|
120
|
+
# * #prev_float: Returns the next-smaller representable Float.
|
|
121
|
+
# * #quo: Returns the quotient from dividing `self` by the given value.
|
|
122
|
+
# * #round: Returns `self` rounded to the nearest value, to a given precision.
|
|
123
|
+
# * #to_i (aliased as #to_int): Returns `self` truncated to an Integer.
|
|
124
|
+
# * #to_s (aliased as #inspect): Returns a string containing the place-value
|
|
125
|
+
# representation of `self` in the given radix.
|
|
126
|
+
# * #truncate: Returns `self` truncated to a given precision.
|
|
4
127
|
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
128
|
+
# <!-- rdoc-file=float.rb -->
|
|
129
|
+
# A Float object stores a real number using the native architecture's
|
|
130
|
+
# double-precision floating-point representation.
|
|
131
|
+
#
|
|
132
|
+
# ## Float Imprecisions
|
|
133
|
+
#
|
|
134
|
+
# Some real numbers can be represented precisely as Float objects:
|
|
135
|
+
#
|
|
136
|
+
# 37.5 # => 37.5
|
|
137
|
+
# 98.75 # => 98.75
|
|
138
|
+
# 12.3125 # => 12.3125
|
|
139
|
+
#
|
|
140
|
+
# Others cannot; among these are the transcendental numbers, including:
|
|
141
|
+
#
|
|
142
|
+
# * Pi, *π*: in mathematics, a number of infinite precision:
|
|
143
|
+
# 3.1415926535897932384626433... (to 25 places); in Ruby, it is of limited
|
|
144
|
+
# precision (in this case, to 16 decimal places):
|
|
145
|
+
#
|
|
146
|
+
# Math::PI # => 3.141592653589793
|
|
147
|
+
#
|
|
148
|
+
# * Euler's number, *e*: in mathematics, a number of infinite precision:
|
|
149
|
+
# 2.7182818284590452353602874... (to 25 places); in Ruby, it is of limited
|
|
150
|
+
# precision (in this case, to 15 decimal places):
|
|
151
|
+
#
|
|
152
|
+
# Math::E # => 2.718281828459045
|
|
153
|
+
#
|
|
154
|
+
# Some floating-point computations in Ruby give precise results:
|
|
155
|
+
#
|
|
156
|
+
# 1.0/2 # => 0.5
|
|
157
|
+
# 100.0/8 # => 12.5
|
|
158
|
+
#
|
|
159
|
+
# Others do not:
|
|
160
|
+
#
|
|
161
|
+
# * In mathematics, 2/3 as a decimal number is an infinitely-repeating
|
|
162
|
+
# decimal: 0.666... (forever); in Ruby, `2.0/3` is of limited precision (in
|
|
163
|
+
# this case, to 16 decimal places):
|
|
164
|
+
#
|
|
165
|
+
# 2.0/3 # => 0.6666666666666666
|
|
166
|
+
#
|
|
167
|
+
# * In mathematics, the square root of 2 is an irrational number of infinite
|
|
168
|
+
# precision: 1.4142135623730950488016887... (to 25 decimal places); in Ruby,
|
|
169
|
+
# it is of limited precision (in this case, to 16 decimal places):
|
|
170
|
+
#
|
|
171
|
+
# Math.sqrt(2.0) # => 1.4142135623730951
|
|
172
|
+
#
|
|
173
|
+
# * Even a simple computation can introduce imprecision:
|
|
174
|
+
#
|
|
175
|
+
# x = 0.1 + 0.2 # => 0.30000000000000004
|
|
176
|
+
# y = 0.3 # => 0.3
|
|
177
|
+
# x == y # => false
|
|
178
|
+
#
|
|
179
|
+
# See:
|
|
7
180
|
#
|
|
8
181
|
# * https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
|
|
9
182
|
# * https://github.com/rdp/ruby_tutorials_core/wiki/Ruby-Talk-FAQ#-why-are-rub
|
|
10
183
|
# ys-floats-imprecise
|
|
11
184
|
# * https://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
|
|
12
185
|
#
|
|
186
|
+
# Note that precise storage and computation of rational numbers is possible
|
|
187
|
+
# using Rational objects.
|
|
188
|
+
#
|
|
189
|
+
# ## Creating a Float
|
|
190
|
+
#
|
|
13
191
|
# You can create a Float object explicitly with:
|
|
14
192
|
#
|
|
15
193
|
# * A [floating-point literal](rdoc-ref:syntax/literals.rdoc@Float+Literals).
|
|
@@ -79,7 +257,7 @@ class Float < Numeric
|
|
|
79
257
|
# rdoc-file=numeric.c
|
|
80
258
|
# - self % other -> float
|
|
81
259
|
# -->
|
|
82
|
-
# Returns `self` modulo `other` as a
|
|
260
|
+
# Returns `self` modulo `other` as a Float.
|
|
83
261
|
#
|
|
84
262
|
# For float `f` and real number `r`, these expressions are equivalent:
|
|
85
263
|
#
|
|
@@ -111,7 +289,7 @@ class Float < Numeric
|
|
|
111
289
|
# rdoc-file=numeric.c
|
|
112
290
|
# - self * other -> numeric
|
|
113
291
|
# -->
|
|
114
|
-
# Returns
|
|
292
|
+
# Returns the numeric product of `self` and `other`:
|
|
115
293
|
#
|
|
116
294
|
# f = 3.14
|
|
117
295
|
# f * 2 # => 6.28
|
|
@@ -124,9 +302,9 @@ class Float < Numeric
|
|
|
124
302
|
|
|
125
303
|
# <!--
|
|
126
304
|
# rdoc-file=numeric.c
|
|
127
|
-
# - self **
|
|
305
|
+
# - self ** exponent -> numeric
|
|
128
306
|
# -->
|
|
129
|
-
#
|
|
307
|
+
# Returns `self` raised to the power `exponent`:
|
|
130
308
|
#
|
|
131
309
|
# f = 3.14
|
|
132
310
|
# f ** 2 # => 9.8596
|
|
@@ -140,15 +318,20 @@ class Float < Numeric
|
|
|
140
318
|
|
|
141
319
|
# <!--
|
|
142
320
|
# rdoc-file=numeric.c
|
|
143
|
-
# - self + other ->
|
|
321
|
+
# - self + other -> float or complex
|
|
144
322
|
# -->
|
|
145
|
-
# Returns
|
|
323
|
+
# Returns the sum of `self` and `other`; the result may be inexact (see Float):
|
|
146
324
|
#
|
|
147
|
-
#
|
|
148
|
-
#
|
|
149
|
-
#
|
|
150
|
-
#
|
|
151
|
-
#
|
|
325
|
+
# 3.14 + 0 # => 3.14
|
|
326
|
+
# 3.14 + 1 # => 4.140000000000001
|
|
327
|
+
# -3.14 + 0 # => -3.14
|
|
328
|
+
# -3.14 + 1 # => -2.14
|
|
329
|
+
#
|
|
330
|
+
# 3.14 + -3.14 # => 0.0
|
|
331
|
+
# -3.14 + -3.14 # => -6.28
|
|
332
|
+
#
|
|
333
|
+
# 3.14 + Complex(1, 0) # => (4.140000000000001+0i)
|
|
334
|
+
# 3.14 + Rational(1, 1) # => 4.140000000000001
|
|
152
335
|
#
|
|
153
336
|
def +: (Complex) -> Complex
|
|
154
337
|
| (Numeric) -> Float
|
|
@@ -159,7 +342,7 @@ class Float < Numeric
|
|
|
159
342
|
# rdoc-file=numeric.c
|
|
160
343
|
# - self - other -> numeric
|
|
161
344
|
# -->
|
|
162
|
-
# Returns
|
|
345
|
+
# Returns the difference of `self` and `other`:
|
|
163
346
|
#
|
|
164
347
|
# f = 3.14
|
|
165
348
|
# f - 1 # => 2.14
|
|
@@ -172,9 +355,13 @@ class Float < Numeric
|
|
|
172
355
|
|
|
173
356
|
# <!--
|
|
174
357
|
# rdoc-file=numeric.rb
|
|
175
|
-
# - -
|
|
358
|
+
# - -self -> float
|
|
176
359
|
# -->
|
|
177
|
-
# Returns `self`, negated
|
|
360
|
+
# Returns `self`, negated:
|
|
361
|
+
#
|
|
362
|
+
# -3.14 # => -3.14
|
|
363
|
+
# -(-3.14) # => 3.14
|
|
364
|
+
# -0.0 # => -0.0
|
|
178
365
|
#
|
|
179
366
|
def -@: () -> Float
|
|
180
367
|
|
|
@@ -182,7 +369,7 @@ class Float < Numeric
|
|
|
182
369
|
# rdoc-file=numeric.c
|
|
183
370
|
# - self / other -> numeric
|
|
184
371
|
# -->
|
|
185
|
-
# Returns
|
|
372
|
+
# Returns the quotient of `self` and `other`:
|
|
186
373
|
#
|
|
187
374
|
# f = 3.14
|
|
188
375
|
# f / 2 # => 1.57
|
|
@@ -197,7 +384,8 @@ class Float < Numeric
|
|
|
197
384
|
# rdoc-file=numeric.c
|
|
198
385
|
# - self < other -> true or false
|
|
199
386
|
# -->
|
|
200
|
-
# Returns
|
|
387
|
+
# Returns whether the value of `self` is less than the value of `other`; `other`
|
|
388
|
+
# must be numeric, but may not be Complex:
|
|
201
389
|
#
|
|
202
390
|
# 2.0 < 3 # => true
|
|
203
391
|
# 2.0 < 3.0 # => true
|
|
@@ -212,7 +400,8 @@ class Float < Numeric
|
|
|
212
400
|
# rdoc-file=numeric.c
|
|
213
401
|
# - self <= other -> true or false
|
|
214
402
|
# -->
|
|
215
|
-
# Returns
|
|
403
|
+
# Returns whether the value of `self` is less than or equal to the value of
|
|
404
|
+
# `other`; `other` must be numeric, but may not be Complex:
|
|
216
405
|
#
|
|
217
406
|
# 2.0 <= 3 # => true
|
|
218
407
|
# 2.0 <= 3.0 # => true
|
|
@@ -226,30 +415,32 @@ class Float < Numeric
|
|
|
226
415
|
|
|
227
416
|
# <!--
|
|
228
417
|
# rdoc-file=numeric.c
|
|
229
|
-
# - self <=> other -> -1, 0,
|
|
418
|
+
# - self <=> other -> -1, 0, 1, or nil
|
|
230
419
|
# -->
|
|
231
|
-
#
|
|
232
|
-
#
|
|
420
|
+
# Compares `self` and `other`.
|
|
421
|
+
#
|
|
422
|
+
# Returns:
|
|
233
423
|
#
|
|
234
|
-
# *
|
|
235
|
-
# * 0
|
|
236
|
-
# * 1
|
|
424
|
+
# * `-1`, if `self` is less than `other`.
|
|
425
|
+
# * `0`, if `self` is equal to `other`.
|
|
426
|
+
# * `1`, if `self` is greater than `other`.
|
|
237
427
|
# * `nil`, if the two values are incommensurate.
|
|
238
428
|
#
|
|
239
429
|
# Examples:
|
|
240
430
|
#
|
|
431
|
+
# 2.0 <=> 2.1 # => -1
|
|
241
432
|
# 2.0 <=> 2 # => 0
|
|
242
433
|
# 2.0 <=> 2.0 # => 0
|
|
243
434
|
# 2.0 <=> Rational(2, 1) # => 0
|
|
244
435
|
# 2.0 <=> Complex(2, 0) # => 0
|
|
245
436
|
# 2.0 <=> 1.9 # => 1
|
|
246
|
-
# 2.0 <=> 2.1 # => -1
|
|
247
437
|
# 2.0 <=> 'foo' # => nil
|
|
248
438
|
#
|
|
249
|
-
# This is the basis for the tests in the Comparable module.
|
|
250
|
-
#
|
|
251
439
|
# `Float::NAN <=> Float::NAN` returns an implementation-dependent value.
|
|
252
440
|
#
|
|
441
|
+
# Class Float includes module Comparable, each of whose methods uses Float#<=>
|
|
442
|
+
# for comparison.
|
|
443
|
+
#
|
|
253
444
|
def <=>: (Numeric) -> Integer?
|
|
254
445
|
|
|
255
446
|
# <!--
|
|
@@ -646,7 +837,7 @@ class Float < Numeric
|
|
|
646
837
|
alias magnitude abs
|
|
647
838
|
|
|
648
839
|
# <!-- rdoc-file=numeric.c -->
|
|
649
|
-
# Returns `self` modulo `other` as a
|
|
840
|
+
# Returns `self` modulo `other` as a Float.
|
|
650
841
|
#
|
|
651
842
|
# For float `f` and real number `r`, these expressions are equivalent:
|
|
652
843
|
#
|
data/core/gc.rbs
CHANGED
|
@@ -281,7 +281,7 @@ module GC
|
|
|
281
281
|
# execution both before the method returns and afterward; therefore
|
|
282
282
|
# sweeping may not be completed before the return.
|
|
283
283
|
#
|
|
284
|
-
# Note that these
|
|
284
|
+
# Note that these keyword arguments are implementation- and version-dependent,
|
|
285
285
|
# are not guaranteed to be future-compatible, and may be ignored in some
|
|
286
286
|
# implementations.
|
|
287
287
|
#
|
|
@@ -351,8 +351,9 @@ module GC
|
|
|
351
351
|
# * `:count`: The total number of garbage collections run since application
|
|
352
352
|
# start (count includes both minor and major garbage collections).
|
|
353
353
|
# * `:time`: The total time spent in garbage collections (in milliseconds).
|
|
354
|
-
# * `:heap_allocated_pages`: The total number of
|
|
355
|
-
#
|
|
354
|
+
# * `:heap_allocated_pages`: The total number of allocated pages.
|
|
355
|
+
# * `:heap_empty_pages`: The number of pages with no live objects, and that
|
|
356
|
+
# could be released to the system.
|
|
356
357
|
# * `:heap_sorted_length`: The number of pages that can fit into the buffer
|
|
357
358
|
# that holds references to all pages.
|
|
358
359
|
# * `:heap_allocatable_pages`: The total number of pages the application could
|
|
@@ -367,8 +368,6 @@ module GC
|
|
|
367
368
|
# * `:heap_marked_slots`: The total number of objects marked in the last GC.
|
|
368
369
|
# * `:heap_eden_pages`: The total number of pages which contain at least one
|
|
369
370
|
# live slot.
|
|
370
|
-
# * `:heap_tomb_pages`: The total number of pages which do not contain any
|
|
371
|
-
# live slots.
|
|
372
371
|
# * `:total_allocated_pages`: The cumulative number of pages allocated since
|
|
373
372
|
# application start.
|
|
374
373
|
# * `:total_freed_pages`: The cumulative number of pages freed since
|
|
@@ -582,10 +581,6 @@ module GC
|
|
|
582
581
|
# * `:heap_eden_pages`: The number of pages in the eden heap.
|
|
583
582
|
# * `:heap_eden_slots`: The total number of slots in all of the pages in the
|
|
584
583
|
# eden heap.
|
|
585
|
-
# * `:heap_tomb_pages`: The number of pages in the tomb heap. The tomb heap
|
|
586
|
-
# only contains pages that do not have any live objects.
|
|
587
|
-
# * `:heap_tomb_slots`: The total number of slots in all of the pages in the
|
|
588
|
-
# tomb heap.
|
|
589
584
|
# * `:total_allocated_pages`: The total number of pages that have been
|
|
590
585
|
# allocated in the heap.
|
|
591
586
|
# * `:total_freed_pages`: The total number of pages that have been freed and
|
data/core/hash.rbs
CHANGED
|
@@ -534,10 +534,10 @@ class Hash[unchecked out K, unchecked out V] < Object
|
|
|
534
534
|
|
|
535
535
|
# <!--
|
|
536
536
|
# rdoc-file=hash.c
|
|
537
|
-
# - self <
|
|
537
|
+
# - self < other -> true or false
|
|
538
538
|
# -->
|
|
539
|
-
# Returns
|
|
540
|
-
# `
|
|
539
|
+
# Returns whether the entries of `self` are a proper subset of the entries of
|
|
540
|
+
# `other`:
|
|
541
541
|
#
|
|
542
542
|
# h = {foo: 0, bar: 1}
|
|
543
543
|
# h < {foo: 0, bar: 1, baz: 2} # => true # Proper subset.
|
|
@@ -547,7 +547,7 @@ class Hash[unchecked out K, unchecked out V] < Object
|
|
|
547
547
|
# h < {foo: 0, bar: 1, baz: 2} # => false # Different key.
|
|
548
548
|
# h < {foo: 0, bar: 1, baz: 2} # => false # Different value.
|
|
549
549
|
#
|
|
550
|
-
# See [Hash Inclusion](rdoc-ref:hash_inclusion.rdoc).
|
|
550
|
+
# See [Hash Inclusion](rdoc-ref:language/hash_inclusion.rdoc).
|
|
551
551
|
#
|
|
552
552
|
# Raises TypeError if `other_hash` is not a hash and cannot be converted to a
|
|
553
553
|
# hash.
|
|
@@ -558,10 +558,9 @@ class Hash[unchecked out K, unchecked out V] < Object
|
|
|
558
558
|
|
|
559
559
|
# <!--
|
|
560
560
|
# rdoc-file=hash.c
|
|
561
|
-
# - self <=
|
|
561
|
+
# - self <= other -> true or false
|
|
562
562
|
# -->
|
|
563
|
-
# Returns
|
|
564
|
-
# `other_hash`, `false` otherwise:
|
|
563
|
+
# Returns whether the entries of `self` are a subset of the entries of `other`:
|
|
565
564
|
#
|
|
566
565
|
# h0 = {foo: 0, bar: 1}
|
|
567
566
|
# h1 = {foo: 0, bar: 1, baz: 2}
|
|
@@ -569,7 +568,7 @@ class Hash[unchecked out K, unchecked out V] < Object
|
|
|
569
568
|
# h0 <= h1 # => true
|
|
570
569
|
# h1 <= h0 # => false
|
|
571
570
|
#
|
|
572
|
-
# See [Hash Inclusion](rdoc-ref:hash_inclusion.rdoc).
|
|
571
|
+
# See [Hash Inclusion](rdoc-ref:language/hash_inclusion.rdoc).
|
|
573
572
|
#
|
|
574
573
|
# Raises TypeError if `other_hash` is not a hash and cannot be converted to a
|
|
575
574
|
# hash.
|
|
@@ -621,7 +620,7 @@ class Hash[unchecked out K, unchecked out V] < Object
|
|
|
621
620
|
# h > {foo: 0, bar: 1} # => false # Different key.
|
|
622
621
|
# h > {foo: 0, bar: 1} # => false # Different value.
|
|
623
622
|
#
|
|
624
|
-
# See [Hash Inclusion](rdoc-ref:hash_inclusion.rdoc).
|
|
623
|
+
# See [Hash Inclusion](rdoc-ref:language/hash_inclusion.rdoc).
|
|
625
624
|
#
|
|
626
625
|
# Raises TypeError if `other_hash` is not a hash and cannot be converted to a
|
|
627
626
|
# hash.
|
|
@@ -643,7 +642,7 @@ class Hash[unchecked out K, unchecked out V] < Object
|
|
|
643
642
|
# h0 >= h0 # => true
|
|
644
643
|
# h1 >= h0 # => false
|
|
645
644
|
#
|
|
646
|
-
# See [Hash Inclusion](rdoc-ref:hash_inclusion.rdoc).
|
|
645
|
+
# See [Hash Inclusion](rdoc-ref:language/hash_inclusion.rdoc).
|
|
647
646
|
#
|
|
648
647
|
# Raises TypeError if `other_hash` is not a hash and cannot be converted to a
|
|
649
648
|
# hash.
|