rbs 4.0.0.dev.5 → 4.0.1.dev.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/.clang-format +1 -0
- data/.github/workflows/c-check.yml +8 -4
- data/.github/workflows/comments.yml +3 -1
- data/.github/workflows/dependabot.yml +1 -1
- data/.github/workflows/ruby.yml +10 -0
- data/.github/workflows/rust.yml +95 -0
- data/CHANGELOG.md +323 -0
- data/Rakefile +12 -29
- data/Steepfile +1 -0
- data/config.yml +393 -37
- data/core/array.rbs +218 -188
- data/core/basic_object.rbs +9 -8
- data/core/class.rbs +6 -5
- data/core/comparable.rbs +45 -31
- data/core/complex.rbs +52 -40
- data/core/dir.rbs +57 -45
- data/core/encoding.rbs +5 -5
- data/core/enumerable.rbs +96 -91
- data/core/enumerator.rbs +4 -3
- data/core/errno.rbs +3 -2
- data/core/errors.rbs +31 -29
- data/core/exception.rbs +12 -12
- data/core/fiber.rbs +36 -36
- data/core/file.rbs +186 -113
- data/core/file_test.rbs +2 -2
- data/core/float.rbs +41 -32
- data/core/gc.rbs +78 -70
- data/core/hash.rbs +70 -60
- data/core/integer.rbs +32 -28
- data/core/io/buffer.rbs +36 -36
- data/core/io/wait.rbs +7 -7
- data/core/io.rbs +120 -135
- data/core/kernel.rbs +189 -139
- data/core/marshal.rbs +3 -3
- data/core/match_data.rbs +14 -12
- data/core/math.rbs +69 -67
- data/core/method.rbs +6 -6
- data/core/module.rbs +146 -85
- data/core/nil_class.rbs +4 -3
- data/core/numeric.rbs +35 -32
- data/core/object.rbs +6 -8
- data/core/object_space.rbs +11 -10
- data/core/pathname.rbs +131 -81
- data/core/proc.rbs +65 -33
- data/core/process.rbs +219 -201
- data/core/ractor.rbs +15 -11
- data/core/random.rbs +4 -3
- data/core/range.rbs +52 -47
- data/core/rational.rbs +5 -5
- data/core/rbs/unnamed/argf.rbs +58 -51
- data/core/rbs/unnamed/env_class.rbs +18 -13
- data/core/rbs/unnamed/main_class.rbs +123 -0
- data/core/rbs/unnamed/random.rbs +7 -5
- data/core/regexp.rbs +236 -197
- data/core/ruby.rbs +1 -1
- data/core/ruby_vm.rbs +32 -30
- data/core/rubygems/config_file.rbs +5 -5
- data/core/rubygems/errors.rbs +1 -1
- data/core/rubygems/requirement.rbs +5 -5
- data/core/rubygems/rubygems.rbs +5 -3
- data/core/set.rbs +17 -16
- data/core/signal.rbs +2 -2
- data/core/string.rbs +311 -292
- data/core/struct.rbs +26 -25
- data/core/symbol.rbs +25 -24
- data/core/thread.rbs +40 -34
- data/core/time.rbs +47 -42
- data/core/trace_point.rbs +34 -31
- data/core/true_class.rbs +2 -2
- data/core/unbound_method.rbs +10 -10
- data/core/warning.rbs +7 -7
- data/docs/collection.md +1 -1
- data/docs/config.md +171 -0
- data/docs/inline.md +110 -4
- data/docs/syntax.md +13 -12
- data/ext/rbs_extension/ast_translation.c +489 -135
- data/ext/rbs_extension/class_constants.c +8 -0
- data/ext/rbs_extension/class_constants.h +4 -0
- data/ext/rbs_extension/legacy_location.c +28 -51
- data/ext/rbs_extension/legacy_location.h +37 -0
- data/ext/rbs_extension/main.c +12 -20
- data/include/rbs/ast.h +423 -195
- data/include/rbs/lexer.h +2 -2
- data/include/rbs/location.h +25 -44
- data/include/rbs/parser.h +2 -2
- data/include/rbs/util/rbs_constant_pool.h +0 -3
- data/include/rbs.h +8 -0
- data/lib/rbs/ast/ruby/annotations.rb +157 -4
- data/lib/rbs/ast/ruby/members.rb +374 -22
- data/lib/rbs/cli/validate.rb +5 -60
- data/lib/rbs/collection/config/lockfile_generator.rb +6 -2
- data/lib/rbs/definition_builder.rb +60 -27
- data/lib/rbs/errors.rb +0 -11
- data/lib/rbs/inline_parser.rb +1 -1
- data/lib/rbs/parser_aux.rb +20 -7
- data/lib/rbs/prototype/helpers.rb +57 -0
- data/lib/rbs/prototype/rb.rb +1 -26
- data/lib/rbs/prototype/rbi.rb +1 -20
- data/lib/rbs/test/type_check.rb +3 -0
- data/lib/rbs/types.rb +62 -52
- data/lib/rbs/unit_test/type_assertions.rb +35 -8
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs.rb +0 -1
- data/rbs.gemspec +1 -1
- data/rust/.gitignore +1 -0
- data/rust/Cargo.lock +378 -0
- data/rust/Cargo.toml +7 -0
- data/rust/ruby-rbs/Cargo.toml +22 -0
- data/rust/ruby-rbs/build.rs +764 -0
- data/rust/ruby-rbs/examples/locations.rs +60 -0
- data/rust/ruby-rbs/src/lib.rs +1 -0
- data/rust/ruby-rbs/src/node/mod.rs +742 -0
- data/rust/ruby-rbs/tests/sanity.rs +47 -0
- data/rust/ruby-rbs/vendor/rbs/config.yml +1 -0
- data/rust/ruby-rbs-sys/Cargo.toml +23 -0
- data/rust/ruby-rbs-sys/build.rs +204 -0
- data/rust/ruby-rbs-sys/src/lib.rs +50 -0
- data/rust/ruby-rbs-sys/vendor/rbs/include +1 -0
- data/rust/ruby-rbs-sys/vendor/rbs/src +1 -0
- data/rust/ruby-rbs-sys/wrapper.h +1 -0
- data/sig/ast/ruby/annotations.rbs +191 -4
- data/sig/ast/ruby/members.rbs +21 -1
- data/sig/cli/validate.rbs +1 -6
- data/sig/definition_builder.rbs +2 -0
- data/sig/errors.rbs +0 -8
- data/sig/method_types.rbs +1 -1
- data/sig/parser.rbs +17 -13
- data/sig/prototype/helpers.rbs +2 -0
- data/sig/types.rbs +10 -11
- data/sig/unit_test/spy.rbs +0 -8
- data/sig/unit_test/type_assertions.rbs +11 -0
- data/src/ast.c +339 -161
- data/src/lexstate.c +1 -1
- data/src/location.c +7 -47
- data/src/parser.c +674 -480
- data/src/util/rbs_constant_pool.c +0 -4
- data/stdlib/bigdecimal/0/big_decimal.rbs +16 -16
- data/stdlib/cgi-escape/0/escape.rbs +4 -4
- data/stdlib/coverage/0/coverage.rbs +4 -3
- data/stdlib/date/0/date.rbs +33 -28
- data/stdlib/date/0/date_time.rbs +24 -23
- data/stdlib/did_you_mean/0/did_you_mean.rbs +17 -16
- data/stdlib/erb/0/erb.rbs +64 -53
- data/stdlib/etc/0/etc.rbs +55 -50
- data/stdlib/fileutils/0/fileutils.rbs +138 -125
- data/stdlib/forwardable/0/forwardable.rbs +10 -10
- data/stdlib/io-console/0/io-console.rbs +2 -2
- data/stdlib/json/0/json.rbs +135 -108
- data/stdlib/monitor/0/monitor.rbs +3 -3
- data/stdlib/net-http/0/net-http.rbs +159 -134
- data/stdlib/objspace/0/objspace.rbs +8 -7
- data/stdlib/open-uri/0/open-uri.rbs +8 -8
- data/stdlib/open3/0/open3.rbs +36 -35
- data/stdlib/openssl/0/openssl.rbs +144 -129
- data/stdlib/optparse/0/optparse.rbs +18 -14
- data/stdlib/pathname/0/pathname.rbs +2 -2
- data/stdlib/pp/0/pp.rbs +9 -8
- data/stdlib/prettyprint/0/prettyprint.rbs +7 -7
- data/stdlib/pstore/0/pstore.rbs +35 -30
- data/stdlib/psych/0/psych.rbs +61 -8
- data/stdlib/psych/0/store.rbs +2 -4
- data/stdlib/pty/0/pty.rbs +9 -6
- data/stdlib/random-formatter/0/random-formatter.rbs +2 -2
- data/stdlib/ripper/0/ripper.rbs +20 -17
- data/stdlib/securerandom/0/securerandom.rbs +1 -1
- data/stdlib/shellwords/0/shellwords.rbs +2 -2
- data/stdlib/socket/0/addrinfo.rbs +7 -7
- data/stdlib/socket/0/basic_socket.rbs +3 -3
- data/stdlib/socket/0/ip_socket.rbs +10 -8
- data/stdlib/socket/0/socket.rbs +10 -9
- data/stdlib/socket/0/tcp_server.rbs +1 -1
- data/stdlib/socket/0/tcp_socket.rbs +1 -1
- data/stdlib/socket/0/udp_socket.rbs +1 -1
- data/stdlib/socket/0/unix_server.rbs +1 -1
- data/stdlib/stringio/0/stringio.rbs +55 -54
- data/stdlib/strscan/0/string_scanner.rbs +46 -44
- data/stdlib/tempfile/0/tempfile.rbs +24 -20
- data/stdlib/time/0/time.rbs +7 -5
- data/stdlib/tsort/0/tsort.rbs +7 -6
- data/stdlib/uri/0/common.rbs +26 -18
- data/stdlib/uri/0/file.rbs +2 -2
- data/stdlib/uri/0/generic.rbs +2 -2
- data/stdlib/uri/0/http.rbs +2 -2
- data/stdlib/uri/0/ldap.rbs +2 -2
- data/stdlib/uri/0/mailto.rbs +3 -3
- data/stdlib/uri/0/rfc2396_parser.rbs +6 -5
- data/stdlib/zlib/0/deflate.rbs +4 -3
- data/stdlib/zlib/0/gzip_reader.rbs +4 -4
- data/stdlib/zlib/0/gzip_writer.rbs +14 -12
- data/stdlib/zlib/0/inflate.rbs +1 -1
- data/stdlib/zlib/0/need_dict.rbs +1 -1
- metadata +23 -5
- data/.github/workflows/valgrind.yml +0 -42
data/core/float.rbs
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
#
|
|
13
13
|
# Others cannot; among these are the transcendental numbers, including:
|
|
14
14
|
#
|
|
15
|
-
# * Pi,
|
|
15
|
+
# * Pi, <em>π</em>: in mathematics, a number of infinite precision:
|
|
16
16
|
# 3.1415926535897932384626433... (to 25 places); in Ruby, it is of limited
|
|
17
17
|
# precision (in this case, to 16 decimal places):
|
|
18
18
|
#
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
# Others do not:
|
|
33
33
|
#
|
|
34
34
|
# * In mathematics, 2/3 as a decimal number is an infinitely-repeating
|
|
35
|
-
# decimal: 0.666... (forever); in Ruby,
|
|
36
|
-
# this case, to 16 decimal places):
|
|
35
|
+
# decimal: 0.666... (forever); in Ruby, <code>2.0/3</code> is of limited
|
|
36
|
+
# precision (in this case, to 16 decimal places):
|
|
37
37
|
#
|
|
38
38
|
# 2.0/3 # => 0.6666666666666666
|
|
39
39
|
#
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
#
|
|
140
140
|
# Others cannot; among these are the transcendental numbers, including:
|
|
141
141
|
#
|
|
142
|
-
# * Pi,
|
|
142
|
+
# * Pi, <em>π</em>: in mathematics, a number of infinite precision:
|
|
143
143
|
# 3.1415926535897932384626433... (to 25 places); in Ruby, it is of limited
|
|
144
144
|
# precision (in this case, to 16 decimal places):
|
|
145
145
|
#
|
|
@@ -159,8 +159,8 @@
|
|
|
159
159
|
# Others do not:
|
|
160
160
|
#
|
|
161
161
|
# * In mathematics, 2/3 as a decimal number is an infinitely-repeating
|
|
162
|
-
# decimal: 0.666... (forever); in Ruby,
|
|
163
|
-
# this case, to 16 decimal places):
|
|
162
|
+
# decimal: 0.666... (forever); in Ruby, <code>2.0/3</code> is of limited
|
|
163
|
+
# precision (in this case, to 16 decimal places):
|
|
164
164
|
#
|
|
165
165
|
# 2.0/3 # => 0.6666666666666666
|
|
166
166
|
#
|
|
@@ -390,7 +390,8 @@ class Float < Numeric
|
|
|
390
390
|
# 2.0 < Rational(3, 1) # => true
|
|
391
391
|
# 2.0 < 2.0 # => false
|
|
392
392
|
#
|
|
393
|
-
#
|
|
393
|
+
# <code>Float::NAN < Float::NAN</code> returns an implementation-dependent
|
|
394
|
+
# value.
|
|
394
395
|
#
|
|
395
396
|
def <: (Numeric) -> bool
|
|
396
397
|
|
|
@@ -407,7 +408,8 @@ class Float < Numeric
|
|
|
407
408
|
# 2.0 <= 2.0 # => true
|
|
408
409
|
# 2.0 <= 1.0 # => false
|
|
409
410
|
#
|
|
410
|
-
#
|
|
411
|
+
# <code>Float::NAN <= Float::NAN</code> returns an implementation-dependent
|
|
412
|
+
# value.
|
|
411
413
|
#
|
|
412
414
|
def <=: (Numeric) -> bool
|
|
413
415
|
|
|
@@ -419,7 +421,7 @@ class Float < Numeric
|
|
|
419
421
|
#
|
|
420
422
|
# Returns:
|
|
421
423
|
#
|
|
422
|
-
# *
|
|
424
|
+
# * <code>-1</code>, if `self` is less than `other`.
|
|
423
425
|
# * `0`, if `self` is equal to `other`.
|
|
424
426
|
# * `1`, if `self` is greater than `other`.
|
|
425
427
|
# * `nil`, if the two values are incommensurate.
|
|
@@ -434,7 +436,8 @@ class Float < Numeric
|
|
|
434
436
|
# 2.0 <=> 1.9 # => 1
|
|
435
437
|
# 2.0 <=> 'foo' # => nil
|
|
436
438
|
#
|
|
437
|
-
#
|
|
439
|
+
# <code>Float::NAN <=> Float::NAN</code> returns an implementation-dependent
|
|
440
|
+
# value.
|
|
438
441
|
#
|
|
439
442
|
# Class Float includes module Comparable, each of whose methods uses Float#<=>
|
|
440
443
|
# for comparison.
|
|
@@ -452,7 +455,8 @@ class Float < Numeric
|
|
|
452
455
|
# 2.0 == Rational(2, 1) # => true
|
|
453
456
|
# 2.0 == Complex(2, 0) # => true
|
|
454
457
|
#
|
|
455
|
-
#
|
|
458
|
+
# <code>Float::NAN == Float::NAN</code> returns an implementation-dependent
|
|
459
|
+
# value.
|
|
456
460
|
#
|
|
457
461
|
# Related: Float#eql? (requires `other` to be a Float).
|
|
458
462
|
#
|
|
@@ -466,7 +470,8 @@ class Float < Numeric
|
|
|
466
470
|
# 2.0 == Rational(2, 1) # => true
|
|
467
471
|
# 2.0 == Complex(2, 0) # => true
|
|
468
472
|
#
|
|
469
|
-
#
|
|
473
|
+
# <code>Float::NAN == Float::NAN</code> returns an implementation-dependent
|
|
474
|
+
# value.
|
|
470
475
|
#
|
|
471
476
|
# Related: Float#eql? (requires `other` to be a Float).
|
|
472
477
|
#
|
|
@@ -483,7 +488,8 @@ class Float < Numeric
|
|
|
483
488
|
# 2.0 > Rational(1, 2) # => true
|
|
484
489
|
# 2.0 > 2.0 # => false
|
|
485
490
|
#
|
|
486
|
-
#
|
|
491
|
+
# <code>Float::NAN > Float::NAN</code> returns an implementation-dependent
|
|
492
|
+
# value.
|
|
487
493
|
#
|
|
488
494
|
def >: (Numeric) -> bool
|
|
489
495
|
|
|
@@ -499,7 +505,8 @@ class Float < Numeric
|
|
|
499
505
|
# 2.0 >= 2.0 # => true
|
|
500
506
|
# 2.0 >= 2.1 # => false
|
|
501
507
|
#
|
|
502
|
-
#
|
|
508
|
+
# <code>Float::NAN >= Float::NAN</code> returns an implementation-dependent
|
|
509
|
+
# value.
|
|
503
510
|
#
|
|
504
511
|
def >=: (Numeric) -> bool
|
|
505
512
|
|
|
@@ -554,7 +561,7 @@ class Float < Numeric
|
|
|
554
561
|
#
|
|
555
562
|
# When `ndigits` is non-positive,
|
|
556
563
|
# returns an Integer based on a computed granularity:
|
|
557
|
-
# * The granularity is
|
|
564
|
+
# * The granularity is <code>10 ** ndigits.abs</code>.
|
|
558
565
|
# * The returned value is the largest multiple of the granularity
|
|
559
566
|
# that is less than or equal to `self`.
|
|
560
567
|
# Examples with positive `self`:
|
|
@@ -620,7 +627,7 @@ class Float < Numeric
|
|
|
620
627
|
# rdoc-file=numeric.c
|
|
621
628
|
# - divmod(other) -> array
|
|
622
629
|
# -->
|
|
623
|
-
# Returns a 2-element array
|
|
630
|
+
# Returns a 2-element array <code>[q, r]</code>, where
|
|
624
631
|
#
|
|
625
632
|
# q = (self/other).floor # Quotient
|
|
626
633
|
# r = self % other # Remainder
|
|
@@ -656,7 +663,8 @@ class Float < Numeric
|
|
|
656
663
|
# 2.0.eql?(Rational(2, 1)) # => false
|
|
657
664
|
# 2.0.eql?(Complex(2, 0)) # => false
|
|
658
665
|
#
|
|
659
|
-
#
|
|
666
|
+
# <code>Float::NAN.eql?(Float::NAN)</code> returns an implementation-dependent
|
|
667
|
+
# value.
|
|
660
668
|
#
|
|
661
669
|
# Related: Float#== (performs type conversions).
|
|
662
670
|
#
|
|
@@ -678,8 +686,8 @@ class Float < Numeric
|
|
|
678
686
|
# rdoc-file=numeric.c
|
|
679
687
|
# - finite? -> true or false
|
|
680
688
|
# -->
|
|
681
|
-
# Returns `true` if `self` is not `Infinity`,
|
|
682
|
-
# otherwise:
|
|
689
|
+
# Returns `true` if `self` is not `Infinity`, <code>-Infinity</code>, or `NaN`,
|
|
690
|
+
# `false` otherwise:
|
|
683
691
|
#
|
|
684
692
|
# f = 2.0 # => 2.0
|
|
685
693
|
# f.finite? # => true
|
|
@@ -724,7 +732,7 @@ class Float < Numeric
|
|
|
724
732
|
#
|
|
725
733
|
# When `self` is non-zero and `ndigits` is non-positive,
|
|
726
734
|
# returns an integer value based on a computed granularity:
|
|
727
|
-
# * The granularity is
|
|
735
|
+
# * The granularity is <code>10 ** ndigits.abs</code>.
|
|
728
736
|
# * The returned value is the largest multiple of the granularity
|
|
729
737
|
# that is less than or equal to `self`.
|
|
730
738
|
# Examples with positive `self`:
|
|
@@ -772,7 +780,7 @@ class Float < Numeric
|
|
|
772
780
|
# Returns:
|
|
773
781
|
#
|
|
774
782
|
# * 1, if `self` is `Infinity`.
|
|
775
|
-
# * -1 if `self` is
|
|
783
|
+
# * -1 if `self` is <code>-Infinity</code>.
|
|
776
784
|
# * `nil`, otherwise.
|
|
777
785
|
#
|
|
778
786
|
# Examples:
|
|
@@ -870,7 +878,7 @@ class Float < Numeric
|
|
|
870
878
|
# Returns the next-larger representable Float.
|
|
871
879
|
#
|
|
872
880
|
# These examples show the internally stored values (64-bit hexadecimal) for each
|
|
873
|
-
# Float `f` and for the corresponding
|
|
881
|
+
# Float `f` and for the corresponding <code>f.next_float</code>:
|
|
874
882
|
#
|
|
875
883
|
# f = 0.0 # 0x0000000000000000
|
|
876
884
|
# f.next_float # 0x0000000000000001
|
|
@@ -944,7 +952,7 @@ class Float < Numeric
|
|
|
944
952
|
# Returns the next-smaller representable Float.
|
|
945
953
|
#
|
|
946
954
|
# These examples show the internally stored values (64-bit hexadecimal) for each
|
|
947
|
-
# Float `f` and for the corresponding
|
|
955
|
+
# Float `f` and for the corresponding <code>f.pev_float</code>:
|
|
948
956
|
#
|
|
949
957
|
# f = 5e-324 # 0x0000000000000001
|
|
950
958
|
# f.prev_float # 0x0000000000000000
|
|
@@ -1025,8 +1033,8 @@ class Float < Numeric
|
|
|
1025
1033
|
# f.round(1) # => -12345.7
|
|
1026
1034
|
# f.round(3) # => -12345.679
|
|
1027
1035
|
#
|
|
1028
|
-
# When `ndigits` is negative, returns an integer with at least
|
|
1029
|
-
# trailing zeros:
|
|
1036
|
+
# When `ndigits` is negative, returns an integer with at least
|
|
1037
|
+
# <code>ndigits.abs</code> trailing zeros:
|
|
1030
1038
|
#
|
|
1031
1039
|
# f = 12345.6789
|
|
1032
1040
|
# f.round(0) # => 12346
|
|
@@ -1038,19 +1046,20 @@ class Float < Numeric
|
|
|
1038
1046
|
# If keyword argument `half` is given, and `self` is equidistant from the two
|
|
1039
1047
|
# candidate values, the rounding is according to the given `half` value:
|
|
1040
1048
|
#
|
|
1041
|
-
# *
|
|
1049
|
+
# * <code>:up</code> or `nil`: round away from zero:
|
|
1042
1050
|
#
|
|
1043
1051
|
# 2.5.round(half: :up) # => 3
|
|
1044
1052
|
# 3.5.round(half: :up) # => 4
|
|
1045
1053
|
# (-2.5).round(half: :up) # => -3
|
|
1046
1054
|
#
|
|
1047
|
-
# *
|
|
1055
|
+
# * <code>:down</code>: round toward zero:
|
|
1048
1056
|
#
|
|
1049
1057
|
# 2.5.round(half: :down) # => 2
|
|
1050
1058
|
# 3.5.round(half: :down) # => 3
|
|
1051
1059
|
# (-2.5).round(half: :down) # => -2
|
|
1052
1060
|
#
|
|
1053
|
-
# *
|
|
1061
|
+
# * <code>:even</code>: round toward the candidate whose last nonzero digit is
|
|
1062
|
+
# even:
|
|
1054
1063
|
#
|
|
1055
1064
|
# 2.5.round(half: :even) # => 2
|
|
1056
1065
|
# 3.5.round(half: :even) # => 4
|
|
@@ -1163,8 +1172,8 @@ class Float < Numeric
|
|
|
1163
1172
|
# f.truncate(1) # => -12345.6
|
|
1164
1173
|
# f.truncate(3) # => -12345.678
|
|
1165
1174
|
#
|
|
1166
|
-
# When `ndigits` is negative, returns an integer with at least
|
|
1167
|
-
# trailing zeros:
|
|
1175
|
+
# When `ndigits` is negative, returns an integer with at least
|
|
1176
|
+
# <code>ndigits.abs</code> trailing zeros:
|
|
1168
1177
|
#
|
|
1169
1178
|
# f = 12345.6789
|
|
1170
1179
|
# f.truncate(0) # => 12345
|
|
@@ -1250,8 +1259,8 @@ Float::MAX_EXP: Integer
|
|
|
1250
1259
|
# Usually defaults to 2.2250738585072014e-308.
|
|
1251
1260
|
#
|
|
1252
1261
|
# If the platform supports denormalized numbers, there are numbers between zero
|
|
1253
|
-
# and Float::MIN.
|
|
1254
|
-
# number including denormalized numbers.
|
|
1262
|
+
# and Float::MIN. <code>0.0.next_float</code> returns the smallest positive
|
|
1263
|
+
# floating point number including denormalized numbers.
|
|
1255
1264
|
#
|
|
1256
1265
|
Float::MIN: Float
|
|
1257
1266
|
|
data/core/gc.rbs
CHANGED
|
@@ -182,21 +182,21 @@ module GC
|
|
|
182
182
|
# GC.config(foo: 'bar')
|
|
183
183
|
# # => {rgengc_allow_full_mark: false, implementation: "default"}
|
|
184
184
|
#
|
|
185
|
-
#
|
|
185
|
+
# <strong>All-Implementations Configuration</strong>
|
|
186
186
|
#
|
|
187
187
|
# The single read-only entry for all implementations is:
|
|
188
188
|
#
|
|
189
|
-
# *
|
|
190
|
-
# default implementation,
|
|
189
|
+
# * <code>:implementation</code>: the string name of the implementation; for
|
|
190
|
+
# the Ruby default implementation, <code>'default'</code>.
|
|
191
191
|
#
|
|
192
|
-
#
|
|
192
|
+
# <strong>Implementation-Specific Configuration</strong>
|
|
193
193
|
#
|
|
194
194
|
# A GC implementation maintains its own implementation-specific configuration.
|
|
195
195
|
#
|
|
196
196
|
# For Ruby's default implementation the single entry is:
|
|
197
197
|
#
|
|
198
|
-
# *
|
|
199
|
-
# full mark (young & old objects):
|
|
198
|
+
# * <code>:rgengc_allow_full_mark</code>: Controls whether the GC is allowed
|
|
199
|
+
# to run a full mark (young & old objects):
|
|
200
200
|
#
|
|
201
201
|
# * `true` (default): GC interleaves major and minor collections. A flag
|
|
202
202
|
# is set to notify GC that a full mark has been requested. This flag is
|
|
@@ -348,59 +348,66 @@ module GC
|
|
|
348
348
|
#
|
|
349
349
|
# The hash includes entries such as:
|
|
350
350
|
#
|
|
351
|
-
# *
|
|
352
|
-
# start (count includes both minor and major garbage
|
|
353
|
-
#
|
|
354
|
-
# *
|
|
355
|
-
#
|
|
356
|
-
#
|
|
357
|
-
# *
|
|
358
|
-
# that
|
|
359
|
-
# *
|
|
360
|
-
#
|
|
361
|
-
# *
|
|
362
|
-
#
|
|
363
|
-
# *
|
|
364
|
-
#
|
|
365
|
-
#
|
|
366
|
-
#
|
|
367
|
-
#
|
|
368
|
-
#
|
|
369
|
-
# *
|
|
370
|
-
#
|
|
371
|
-
# *
|
|
372
|
-
#
|
|
373
|
-
# *
|
|
374
|
-
#
|
|
375
|
-
# *
|
|
351
|
+
# * <code>:count</code>: The total number of garbage collections run since
|
|
352
|
+
# application start (count includes both minor and major garbage
|
|
353
|
+
# collections).
|
|
354
|
+
# * <code>:time</code>: The total time spent in garbage collections (in
|
|
355
|
+
# milliseconds).
|
|
356
|
+
# * <code>:heap_allocated_pages</code>: The total number of allocated pages.
|
|
357
|
+
# * <code>:heap_empty_pages</code>: The number of pages with no live objects,
|
|
358
|
+
# and that could be released to the system.
|
|
359
|
+
# * <code>:heap_sorted_length</code>: The number of pages that can fit into
|
|
360
|
+
# the buffer that holds references to all pages.
|
|
361
|
+
# * <code>:heap_allocatable_pages</code>: The total number of pages the
|
|
362
|
+
# application could allocate without additional GC.
|
|
363
|
+
# * <code>:heap_available_slots</code>: The total number of slots in all
|
|
364
|
+
# <code>:heap_allocated_pages</code>.
|
|
365
|
+
# * <code>:heap_live_slots</code>: The total number of slots which contain
|
|
366
|
+
# live objects.
|
|
367
|
+
# * <code>:heap_free_slots</code>: The total number of slots which do not
|
|
368
|
+
# contain live objects.
|
|
369
|
+
# * <code>:heap_final_slots</code>: The total number of slots with pending
|
|
370
|
+
# finalizers to be run.
|
|
371
|
+
# * <code>:heap_marked_slots</code>: The total number of objects marked in the
|
|
372
|
+
# last GC.
|
|
373
|
+
# * <code>:heap_eden_pages</code>: The total number of pages which contain at
|
|
374
|
+
# least one live slot.
|
|
375
|
+
# * <code>:total_allocated_pages</code>: The cumulative number of pages
|
|
376
|
+
# allocated since application start.
|
|
377
|
+
# * <code>:total_freed_pages</code>: The cumulative number of pages freed
|
|
376
378
|
# since application start.
|
|
377
|
-
# *
|
|
378
|
-
# application start.
|
|
379
|
-
# *
|
|
380
|
-
#
|
|
381
|
-
# *
|
|
382
|
-
#
|
|
383
|
-
# *
|
|
384
|
-
#
|
|
385
|
-
# *
|
|
379
|
+
# * <code>:total_allocated_objects</code>: The cumulative number of objects
|
|
380
|
+
# allocated since application start.
|
|
381
|
+
# * <code>:total_freed_objects</code>: The cumulative number of objects freed
|
|
382
|
+
# since application start.
|
|
383
|
+
# * <code>:malloc_increase_bytes</code>: Amount of memory allocated on the
|
|
384
|
+
# heap for objects. Decreased by any GC.
|
|
385
|
+
# * <code>:malloc_increase_bytes_limit</code>: When
|
|
386
|
+
# <code>:malloc_increase_bytes</code> crosses this limit, GC is triggered.
|
|
387
|
+
# * <code>:minor_gc_count</code>: The total number of minor garbage
|
|
388
|
+
# collections run since process start.
|
|
389
|
+
# * <code>:major_gc_count</code>: The total number of major garbage
|
|
390
|
+
# collections run since process start.
|
|
391
|
+
# * <code>:compact_count</code>: The total number of compactions run since
|
|
386
392
|
# process start.
|
|
387
|
-
# *
|
|
388
|
-
#
|
|
389
|
-
#
|
|
390
|
-
#
|
|
391
|
-
# *
|
|
392
|
-
# write barriers.
|
|
393
|
-
# *
|
|
394
|
-
#
|
|
395
|
-
# triggered.
|
|
396
|
-
# *
|
|
397
|
-
# garbage collections.
|
|
398
|
-
# *
|
|
393
|
+
# * <code>:read_barrier_faults</code>: The total number of times the read
|
|
394
|
+
# barrier was triggered during compaction.
|
|
395
|
+
# * <code>:total_moved_objects</code>: The total number of objects compaction
|
|
396
|
+
# has moved.
|
|
397
|
+
# * <code>:remembered_wb_unprotected_objects</code>: The total number of
|
|
398
|
+
# objects without write barriers.
|
|
399
|
+
# * <code>:remembered_wb_unprotected_objects_limit</code>: When
|
|
400
|
+
# <code>:remembered_wb_unprotected_objects</code> crosses this limit, major
|
|
401
|
+
# GC is triggered.
|
|
402
|
+
# * <code>:old_objects</code>: Number of live, old objects which have survived
|
|
403
|
+
# at least 3 garbage collections.
|
|
404
|
+
# * <code>:old_objects_limit</code>: When <code>:old_objects</code> crosses
|
|
405
|
+
# this limit, major GC is triggered.
|
|
406
|
+
# * <code>:oldmalloc_increase_bytes</code>: Amount of memory allocated on the
|
|
407
|
+
# heap for objects. Decreased by major GC.
|
|
408
|
+
# * <code>:oldmalloc_increase_bytes_limit</code>: When
|
|
409
|
+
# <code>:oldmalloc_increase_bytes</code> crosses this limit, major GC is
|
|
399
410
|
# triggered.
|
|
400
|
-
# * `:oldmalloc_increase_bytes`: Amount of memory allocated on the heap for
|
|
401
|
-
# objects. Decreased by major GC.
|
|
402
|
-
# * `:oldmalloc_increase_bytes_limit`: When `:oldmalloc_increase_bytes`
|
|
403
|
-
# crosses this limit, major GC is triggered.
|
|
404
411
|
#
|
|
405
412
|
def self.stat: (?Hash[Symbol, untyped]? hash) -> Hash[Symbol, untyped]
|
|
406
413
|
| (Symbol key) -> Integer
|
|
@@ -575,21 +582,22 @@ module GC
|
|
|
575
582
|
#
|
|
576
583
|
# The statistics for a heap may include:
|
|
577
584
|
#
|
|
578
|
-
# *
|
|
579
|
-
# *
|
|
580
|
-
# without triggering a new garbage collection cycle.
|
|
581
|
-
# *
|
|
582
|
-
# *
|
|
583
|
-
# eden heap.
|
|
584
|
-
# *
|
|
585
|
-
# allocated in the heap.
|
|
586
|
-
# *
|
|
587
|
-
# released back to the system in the heap.
|
|
588
|
-
# *
|
|
589
|
-
# garbage collection cycles to start due to running out of free
|
|
590
|
-
# * `:force_incremental_marking_finish_count`: The number of times this heap
|
|
591
|
-
# has forced incremental marking to complete due to running out of pooled
|
|
585
|
+
# * <code>:slot_size</code>: The slot size of the heap in bytes.
|
|
586
|
+
# * <code>:heap_allocatable_pages</code>: The number of pages that can be
|
|
587
|
+
# allocated without triggering a new garbage collection cycle.
|
|
588
|
+
# * <code>:heap_eden_pages</code>: The number of pages in the eden heap.
|
|
589
|
+
# * <code>:heap_eden_slots</code>: The total number of slots in all of the
|
|
590
|
+
# pages in the eden heap.
|
|
591
|
+
# * <code>:total_allocated_pages</code>: The total number of pages that have
|
|
592
|
+
# been allocated in the heap.
|
|
593
|
+
# * <code>:total_freed_pages</code>: The total number of pages that have been
|
|
594
|
+
# freed and released back to the system in the heap.
|
|
595
|
+
# * <code>:force_major_gc_count</code>: The number of times this heap has
|
|
596
|
+
# forced major garbage collection cycles to start due to running out of free
|
|
592
597
|
# slots.
|
|
598
|
+
# * <code>:force_incremental_marking_finish_count</code>: The number of times
|
|
599
|
+
# this heap has forced incremental marking to complete due to running out of
|
|
600
|
+
# pooled slots.
|
|
593
601
|
#
|
|
594
602
|
def self.stat_heap: (?Integer? heap_name, ?Hash[Symbol, untyped]? hash) -> Hash[Symbol, untyped]
|
|
595
603
|
| (Integer heap_name, Symbol key) -> Integer
|