rbs 2.0.0 → 2.2.2
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/comments.yml +34 -0
- data/.github/workflows/ruby.yml +5 -0
- data/CHANGELOG.md +82 -0
- data/README.md +6 -1
- data/Rakefile +56 -21
- data/core/array.rbs +2866 -1086
- data/core/basic_object.rbs +150 -30
- data/core/binding.rbs +33 -0
- data/core/builtin.rbs +4 -4
- data/core/class.rbs +43 -5
- data/core/comparable.rbs +57 -0
- data/core/complex.rbs +170 -4
- data/core/constants.rbs +51 -0
- data/core/deprecated.rbs +7 -0
- data/core/dir.rbs +305 -20
- data/core/encoding.rbs +1214 -77
- data/core/enumerable.rbs +2173 -234
- data/core/enumerator.rbs +448 -182
- data/core/env.rbs +448 -1
- data/core/errno.rbs +1 -10
- data/core/errors.rbs +152 -2
- data/core/exception.rbs +201 -127
- data/core/false_class.rbs +27 -0
- data/core/fiber.rbs +118 -37
- data/core/fiber_error.rbs +8 -9
- data/core/file.rbs +1060 -142
- data/core/file_test.rbs +287 -32
- data/core/float.rbs +776 -300
- data/core/gc.rbs +185 -34
- data/core/global_variables.rbs +5 -1
- data/core/hash.rbs +1582 -649
- data/core/integer.rbs +974 -204
- data/core/io/buffer.rbs +710 -0
- data/core/io/wait.rbs +29 -8
- data/core/io.rbs +2438 -417
- data/core/kernel.rbs +2319 -318
- data/core/marshal.rbs +37 -2
- data/core/match_data.rbs +123 -6
- data/core/math.rbs +126 -6
- data/core/method.rbs +226 -102
- data/core/module.rbs +421 -45
- data/core/nil_class.rbs +64 -0
- data/core/numeric.rbs +620 -142
- data/core/object.rbs +453 -81
- data/core/object_space.rbs +92 -2
- data/core/proc.rbs +482 -285
- data/core/process.rbs +443 -34
- data/core/ractor.rbs +232 -9
- data/core/random.rbs +151 -52
- data/core/range.rbs +885 -160
- data/core/rational.rbs +122 -6
- data/core/rb_config.rbs +14 -4
- data/core/refinement.rbs +44 -0
- data/core/regexp.rbs +156 -14
- data/core/ruby_vm.rbs +42 -3
- data/core/signal.rbs +78 -39
- data/core/string.rbs +2123 -567
- data/core/string_io.rbs +204 -0
- data/core/struct.rbs +283 -28
- data/core/symbol.rbs +304 -30
- data/core/thread.rbs +1288 -688
- data/core/thread_group.rbs +66 -10
- data/core/time.rbs +643 -217
- data/core/trace_point.rbs +100 -12
- data/core/true_class.rbs +24 -0
- data/core/unbound_method.rbs +73 -7
- data/core/warning.rbs +37 -12
- data/docs/CONTRIBUTING.md +40 -34
- data/docs/stdlib.md +3 -102
- data/docs/syntax.md +54 -11
- data/ext/rbs_extension/extconf.rb +1 -0
- data/ext/rbs_extension/lexer.h +5 -0
- data/ext/rbs_extension/lexstate.c +6 -0
- data/ext/rbs_extension/parser.c +85 -10
- data/ext/rbs_extension/ruby_objs.c +4 -2
- data/ext/rbs_extension/ruby_objs.h +2 -2
- data/goodcheck.yml +0 -11
- data/lib/rbs/annotate/annotations.rb +197 -0
- data/lib/rbs/annotate/formatter.rb +80 -0
- data/lib/rbs/annotate/rdoc_annotator.rb +398 -0
- data/lib/rbs/annotate/rdoc_source.rb +120 -0
- data/lib/rbs/annotate.rb +6 -0
- data/lib/rbs/ast/members.rb +21 -13
- data/lib/rbs/buffer.rb +17 -11
- data/lib/rbs/cli.rb +48 -1
- data/lib/rbs/definition_builder/method_builder.rb +28 -16
- data/lib/rbs/definition_builder.rb +6 -2
- data/lib/rbs/environment.rb +8 -4
- data/lib/rbs/location_aux.rb +12 -0
- data/lib/rbs/namespace.rb +1 -1
- data/lib/rbs/prototype/rb.rb +12 -0
- data/lib/rbs/type_alias_regularity.rb +6 -4
- data/lib/rbs/type_name.rb +1 -1
- data/lib/rbs/types.rb +1 -1
- data/lib/rbs/validator.rb +6 -0
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs/writer.rb +54 -4
- data/lib/rbs.rb +0 -2
- data/schema/typeParam.json +3 -3
- data/sig/annotate/annotations.rbs +102 -0
- data/sig/annotate/formatter.rbs +24 -0
- data/sig/annotate/rdoc_annotater.rbs +82 -0
- data/sig/annotate/rdoc_source.rbs +30 -0
- data/sig/buffer.rbs +6 -2
- data/sig/cli.rbs +2 -0
- data/sig/collection/{collections.rbs → sources.rbs} +0 -0
- data/sig/location.rbs +6 -0
- data/sig/members.rbs +24 -18
- data/sig/method_builder.rbs +5 -4
- data/sig/method_types.rbs +5 -1
- data/sig/polyfill.rbs +78 -0
- data/sig/validator.rbs +3 -1
- data/sig/writer.rbs +79 -2
- data/stdlib/abbrev/0/abbrev.rbs +6 -0
- data/stdlib/abbrev/0/array.rbs +26 -0
- data/stdlib/base64/0/base64.rbs +31 -0
- data/stdlib/benchmark/0/benchmark.rbs +74 -3
- data/stdlib/bigdecimal/0/big_decimal.rbs +614 -165
- data/stdlib/bigdecimal-math/0/big_math.rbs +41 -64
- data/stdlib/cgi/0/core.rbs +649 -21
- data/stdlib/coverage/0/coverage.rbs +164 -2
- data/stdlib/csv/0/csv.rbs +2862 -398
- data/stdlib/date/0/date.rbs +483 -25
- data/stdlib/date/0/date_time.rbs +187 -12
- data/stdlib/dbm/0/dbm.rbs +152 -17
- data/stdlib/digest/0/digest.rbs +146 -0
- data/stdlib/erb/0/erb.rbs +65 -245
- data/stdlib/fiber/0/fiber.rbs +73 -91
- data/stdlib/fileutils/0/fileutils.rbs +301 -1
- data/stdlib/find/0/find.rbs +9 -0
- data/stdlib/forwardable/0/forwardable.rbs +65 -1
- data/stdlib/io-console/0/io-console.rbs +227 -15
- data/stdlib/ipaddr/0/ipaddr.rbs +161 -0
- data/stdlib/json/0/json.rbs +1147 -145
- data/stdlib/logger/0/formatter.rbs +24 -0
- data/stdlib/logger/0/log_device.rbs +64 -0
- data/stdlib/logger/0/logger.rbs +165 -13
- data/stdlib/logger/0/period.rbs +10 -0
- data/stdlib/logger/0/severity.rbs +26 -0
- data/stdlib/monitor/0/monitor.rbs +163 -0
- data/stdlib/mutex_m/0/mutex_m.rbs +35 -6
- data/stdlib/net-http/0/manifest.yaml +1 -0
- data/stdlib/net-http/0/net-http.rbs +1513 -683
- data/stdlib/nkf/0/nkf.rbs +372 -0
- data/stdlib/objspace/0/objspace.rbs +149 -90
- data/stdlib/openssl/0/openssl.rbs +8108 -71
- data/stdlib/optparse/0/optparse.rbs +487 -19
- data/stdlib/pathname/0/pathname.rbs +425 -124
- data/stdlib/prettyprint/0/prettyprint.rbs +120 -99
- data/stdlib/prime/0/integer-extension.rbs +20 -2
- data/stdlib/prime/0/prime.rbs +88 -21
- data/stdlib/pstore/0/pstore.rbs +102 -0
- data/stdlib/pty/0/pty.rbs +64 -14
- data/stdlib/resolv/0/resolv.rbs +420 -31
- data/stdlib/rubygems/0/basic_specification.rbs +4 -1
- data/stdlib/rubygems/0/config_file.rbs +33 -1
- data/stdlib/rubygems/0/dependency_installer.rbs +4 -3
- data/stdlib/rubygems/0/installer.rbs +13 -1
- data/stdlib/rubygems/0/path_support.rbs +4 -1
- data/stdlib/rubygems/0/platform.rbs +5 -1
- data/stdlib/rubygems/0/request_set.rbs +44 -2
- data/stdlib/rubygems/0/requirement.rbs +65 -2
- data/stdlib/rubygems/0/rubygems.rbs +407 -0
- data/stdlib/rubygems/0/source_list.rbs +13 -0
- data/stdlib/rubygems/0/specification.rbs +21 -1
- data/stdlib/rubygems/0/stream_ui.rbs +3 -1
- data/stdlib/rubygems/0/uninstaller.rbs +8 -1
- data/stdlib/rubygems/0/version.rbs +60 -157
- data/stdlib/securerandom/0/securerandom.rbs +44 -0
- data/stdlib/set/0/set.rbs +423 -109
- data/stdlib/shellwords/0/shellwords.rbs +55 -77
- data/stdlib/singleton/0/singleton.rbs +20 -0
- data/stdlib/socket/0/addrinfo.rbs +210 -9
- data/stdlib/socket/0/basic_socket.rbs +103 -11
- data/stdlib/socket/0/ip_socket.rbs +31 -9
- data/stdlib/socket/0/socket.rbs +586 -38
- data/stdlib/socket/0/tcp_server.rbs +22 -2
- data/stdlib/socket/0/tcp_socket.rbs +12 -1
- data/stdlib/socket/0/udp_socket.rbs +25 -2
- data/stdlib/socket/0/unix_server.rbs +22 -2
- data/stdlib/socket/0/unix_socket.rbs +45 -5
- data/stdlib/strscan/0/string_scanner.rbs +210 -9
- data/stdlib/tempfile/0/tempfile.rbs +58 -10
- data/stdlib/time/0/time.rbs +208 -116
- data/stdlib/timeout/0/timeout.rbs +10 -0
- data/stdlib/tmpdir/0/tmpdir.rbs +13 -4
- data/stdlib/tsort/0/cyclic.rbs +1 -0
- data/stdlib/tsort/0/interfaces.rbs +1 -0
- data/stdlib/tsort/0/tsort.rbs +42 -0
- data/stdlib/uri/0/common.rbs +57 -8
- data/stdlib/uri/0/file.rbs +55 -109
- data/stdlib/uri/0/ftp.rbs +6 -3
- data/stdlib/uri/0/generic.rbs +558 -329
- data/stdlib/uri/0/http.rbs +60 -114
- data/stdlib/uri/0/https.rbs +8 -102
- data/stdlib/uri/0/ldap.rbs +143 -137
- data/stdlib/uri/0/ldaps.rbs +8 -102
- data/stdlib/uri/0/mailto.rbs +3 -0
- data/stdlib/uri/0/rfc2396_parser.rbs +66 -26
- data/stdlib/uri/0/ws.rbs +6 -3
- data/stdlib/uri/0/wss.rbs +5 -3
- data/stdlib/yaml/0/dbm.rbs +151 -87
- data/stdlib/yaml/0/store.rbs +6 -0
- data/stdlib/zlib/0/zlib.rbs +90 -31
- metadata +18 -6
- data/lib/rbs/location.rb +0 -221
- data/sig/char_scanner.rbs +0 -9
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# <!-- rdoc-file=ext/objspace/objspace.c -->
|
|
1
2
|
# The objspace library extends the ObjectSpace module and adds several methods
|
|
2
3
|
# to get internal statistic information about object/memory management.
|
|
3
4
|
#
|
|
@@ -6,29 +7,13 @@
|
|
|
6
7
|
# Generally, you *SHOULD NOT* use this library if you do not know about the MRI
|
|
7
8
|
# implementation. Mainly, this library is for (memory) profiler developers and
|
|
8
9
|
# MRI developers who need to know about MRI memory usage.
|
|
9
|
-
# The ObjectSpace module contains a number of routines that interact with the
|
|
10
|
-
# garbage collection facility and allow you to traverse all living objects with
|
|
11
|
-
# an iterator.
|
|
12
10
|
#
|
|
13
|
-
|
|
14
|
-
# called when a specific object is about to be destroyed by garbage collection.
|
|
15
|
-
# See the documentation for `ObjectSpace.define_finalizer` for important
|
|
16
|
-
# information on how to use this method correctly.
|
|
17
|
-
#
|
|
18
|
-
# a = "A"
|
|
19
|
-
# b = "B"
|
|
20
|
-
#
|
|
21
|
-
# ObjectSpace.define_finalizer(a, proc {|id| puts "Finalizer one on #{id}" })
|
|
22
|
-
# ObjectSpace.define_finalizer(b, proc {|id| puts "Finalizer two on #{id}" })
|
|
23
|
-
#
|
|
24
|
-
# a = nil
|
|
25
|
-
# b = nil
|
|
26
|
-
#
|
|
27
|
-
# *produces:*
|
|
28
|
-
#
|
|
29
|
-
# Finalizer two on 537763470
|
|
30
|
-
# Finalizer one on 537763480
|
|
11
|
+
%a{annotate:rdoc:source:from=ext/objspace}
|
|
31
12
|
module ObjectSpace
|
|
13
|
+
# <!--
|
|
14
|
+
# rdoc-file=ext/objspace/object_tracing.c
|
|
15
|
+
# - allocation_class_path(object) -> string
|
|
16
|
+
# -->
|
|
32
17
|
# Returns the class for the given `object`.
|
|
33
18
|
#
|
|
34
19
|
# class A
|
|
@@ -44,8 +29,12 @@ module ObjectSpace
|
|
|
44
29
|
#
|
|
45
30
|
# See ::trace_object_allocations for more information and examples.
|
|
46
31
|
#
|
|
47
|
-
def self
|
|
32
|
+
def self?.allocation_class_path: (untyped) -> String
|
|
48
33
|
|
|
34
|
+
# <!--
|
|
35
|
+
# rdoc-file=ext/objspace/object_tracing.c
|
|
36
|
+
# - allocation_generation(object) -> integer or nil
|
|
37
|
+
# -->
|
|
49
38
|
# Returns garbage collector generation for the given `object`.
|
|
50
39
|
#
|
|
51
40
|
# class B
|
|
@@ -63,8 +52,12 @@ module ObjectSpace
|
|
|
63
52
|
#
|
|
64
53
|
# See ::trace_object_allocations for more information and examples.
|
|
65
54
|
#
|
|
66
|
-
def self
|
|
55
|
+
def self?.allocation_generation: (untyped) -> (Integer | nil)
|
|
67
56
|
|
|
57
|
+
# <!--
|
|
58
|
+
# rdoc-file=ext/objspace/object_tracing.c
|
|
59
|
+
# - allocation_method_id(object) -> string
|
|
60
|
+
# -->
|
|
68
61
|
# Returns the method identifier for the given `object`.
|
|
69
62
|
#
|
|
70
63
|
# class A
|
|
@@ -82,20 +75,32 @@ module ObjectSpace
|
|
|
82
75
|
#
|
|
83
76
|
# See ::trace_object_allocations for more information and examples.
|
|
84
77
|
#
|
|
85
|
-
def self
|
|
78
|
+
def self?.allocation_method_id: (untyped) -> Symbol
|
|
86
79
|
|
|
80
|
+
# <!--
|
|
81
|
+
# rdoc-file=ext/objspace/object_tracing.c
|
|
82
|
+
# - allocation_sourcefile(object) -> string
|
|
83
|
+
# -->
|
|
87
84
|
# Returns the source file origin from the given `object`.
|
|
88
85
|
#
|
|
89
86
|
# See ::trace_object_allocations for more information and examples.
|
|
90
87
|
#
|
|
91
|
-
def self
|
|
88
|
+
def self?.allocation_sourcefile: (untyped) -> String
|
|
92
89
|
|
|
90
|
+
# <!--
|
|
91
|
+
# rdoc-file=ext/objspace/object_tracing.c
|
|
92
|
+
# - allocation_sourceline(object) -> integer
|
|
93
|
+
# -->
|
|
93
94
|
# Returns the original line from source for from the given `object`.
|
|
94
95
|
#
|
|
95
96
|
# See ::trace_object_allocations for more information and examples.
|
|
96
97
|
#
|
|
97
|
-
def self
|
|
98
|
+
def self?.allocation_sourceline: (untyped) -> Integer
|
|
98
99
|
|
|
100
|
+
# <!--
|
|
101
|
+
# rdoc-file=ext/objspace/objspace.c
|
|
102
|
+
# - ObjectSpace.count_imemo_objects([result_hash]) -> hash
|
|
103
|
+
# -->
|
|
99
104
|
# Counts objects for each `T_IMEMO` type.
|
|
100
105
|
#
|
|
101
106
|
# This method is only for MRI developers interested in performance and memory
|
|
@@ -119,8 +124,12 @@ module ObjectSpace
|
|
|
119
124
|
#
|
|
120
125
|
# This method is only expected to work with C Ruby.
|
|
121
126
|
#
|
|
122
|
-
def self
|
|
127
|
+
def self?.count_imemo_objects: (?Hash[Symbol, Integer] result_hash) -> Hash[Symbol, Integer]
|
|
123
128
|
|
|
129
|
+
# <!--
|
|
130
|
+
# rdoc-file=ext/objspace/objspace.c
|
|
131
|
+
# - ObjectSpace.count_nodes([result_hash]) -> hash
|
|
132
|
+
# -->
|
|
124
133
|
# Counts nodes for each node type.
|
|
125
134
|
#
|
|
126
135
|
# This method is only for MRI developers interested in performance and memory
|
|
@@ -138,8 +147,12 @@ module ObjectSpace
|
|
|
138
147
|
#
|
|
139
148
|
# This method is only expected to work with C Ruby.
|
|
140
149
|
#
|
|
141
|
-
def self
|
|
150
|
+
def self?.count_nodes: (?Hash[Symbol, Integer] result_hash) -> Hash[Symbol, Integer]
|
|
142
151
|
|
|
152
|
+
# <!--
|
|
153
|
+
# rdoc-file=ext/objspace/objspace.c
|
|
154
|
+
# - ObjectSpace.count_objects_size([result_hash]) -> hash
|
|
155
|
+
# -->
|
|
143
156
|
# Counts objects size (in bytes) for each type.
|
|
144
157
|
#
|
|
145
158
|
# Note that this information is incomplete. You need to deal with this
|
|
@@ -157,8 +170,12 @@ module ObjectSpace
|
|
|
157
170
|
#
|
|
158
171
|
# This method is only expected to work with C Ruby.
|
|
159
172
|
#
|
|
160
|
-
def self
|
|
173
|
+
def self?.count_objects_size: (?Hash[Symbol, Integer] result_hash) -> Hash[Symbol, Integer]
|
|
161
174
|
|
|
175
|
+
# <!--
|
|
176
|
+
# rdoc-file=ext/objspace/objspace.c
|
|
177
|
+
# - ObjectSpace.count_symbols([result_hash]) -> hash
|
|
178
|
+
# -->
|
|
162
179
|
# Counts symbols for each Symbol type.
|
|
163
180
|
#
|
|
164
181
|
# This method is only for MRI developers interested in performance and memory
|
|
@@ -179,8 +196,12 @@ module ObjectSpace
|
|
|
179
196
|
# * immortal_static_symbol: Immortal symbols (do not collected by GC)
|
|
180
197
|
# * immortal_symbol: total immortal symbols (immortal_dynamic_symbol+immortal_static_symbol)
|
|
181
198
|
#
|
|
182
|
-
def self
|
|
199
|
+
def self?.count_symbols: (?Hash[Symbol, Integer] result_hash) -> Hash[Symbol, Integer]
|
|
183
200
|
|
|
201
|
+
# <!--
|
|
202
|
+
# rdoc-file=ext/objspace/objspace.c
|
|
203
|
+
# - ObjectSpace.count_tdata_objects([result_hash]) -> hash
|
|
204
|
+
# -->
|
|
184
205
|
# Counts objects for each `T_DATA` type.
|
|
185
206
|
#
|
|
186
207
|
# This method is only for MRI developers interested in performance and memory
|
|
@@ -208,12 +229,55 @@ module ObjectSpace
|
|
|
208
229
|
#
|
|
209
230
|
# This method is only expected to work with C Ruby.
|
|
210
231
|
#
|
|
211
|
-
def self
|
|
232
|
+
def self?.count_tdata_objects: (?Hash[untyped, Integer] result_hash) -> Hash[untyped, Integer]
|
|
212
233
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
234
|
+
# <!--
|
|
235
|
+
# rdoc-file=ext/objspace/lib/objspace.rb
|
|
236
|
+
# - ObjectSpace.dump(obj[, output: :string]) # => "{ ... }"
|
|
237
|
+
# - ObjectSpace.dump(obj, output: :file) # => #<File:/tmp/rubyobj20131125-88733-1xkfmpv.json>
|
|
238
|
+
# - ObjectSpace.dump(obj, output: :stdout) # => nil
|
|
239
|
+
# -->
|
|
240
|
+
# Dump the contents of a ruby object as JSON.
|
|
241
|
+
#
|
|
242
|
+
# This method is only expected to work with C Ruby. This is an experimental
|
|
243
|
+
# method and is subject to change. In particular, the function signature and
|
|
244
|
+
# output format are not guaranteed to be compatible in future versions of ruby.
|
|
245
|
+
#
|
|
246
|
+
def self?.dump: (untyped obj, ?output: Symbol) -> (String | File | nil)
|
|
247
|
+
|
|
248
|
+
# <!--
|
|
249
|
+
# rdoc-file=ext/objspace/lib/objspace.rb
|
|
250
|
+
# - ObjectSpace.dump_all([output: :file]) # => #<File:/tmp/rubyheap20131125-88469-laoj3v.json>
|
|
251
|
+
# - ObjectSpace.dump_all(output: :stdout) # => nil
|
|
252
|
+
# - ObjectSpace.dump_all(output: :string) # => "{...}\n{...}\n..."
|
|
253
|
+
# - ObjectSpace.dump_all(output:
|
|
254
|
+
# - File.open('heap.json','w')) # => #<File:heap.json>
|
|
255
|
+
# - ObjectSpace.dump_all(output: :string,
|
|
256
|
+
# - since: 42) # => "{...}\n{...}\n..."
|
|
257
|
+
# -->
|
|
258
|
+
# Dump the contents of the ruby heap as JSON.
|
|
259
|
+
#
|
|
260
|
+
# *since* must be a non-negative integer or `nil`.
|
|
261
|
+
#
|
|
262
|
+
# If *since* is a positive integer, only objects of that generation and newer
|
|
263
|
+
# generations are dumped. The current generation can be accessed using
|
|
264
|
+
# GC::count.
|
|
265
|
+
#
|
|
266
|
+
# Objects that were allocated without object allocation tracing enabled are
|
|
267
|
+
# ignored. See ::trace_object_allocations for more information and examples.
|
|
268
|
+
#
|
|
269
|
+
# If *since* is omitted or is `nil`, all objects are dumped.
|
|
270
|
+
#
|
|
271
|
+
# This method is only expected to work with C Ruby. This is an experimental
|
|
272
|
+
# method and is subject to change. In particular, the function signature and
|
|
273
|
+
# output format are not guaranteed to be compatible in future versions of ruby.
|
|
274
|
+
#
|
|
275
|
+
def self?.dump_all: (?since: Integer | nil, ?full: boolish, ?output: Symbol) -> (String | File | nil)
|
|
216
276
|
|
|
277
|
+
# <!--
|
|
278
|
+
# rdoc-file=ext/objspace/objspace.c
|
|
279
|
+
# - ObjectSpace.internal_class_of(obj) -> Class or Module
|
|
280
|
+
# -->
|
|
217
281
|
# MRI specific feature
|
|
218
282
|
# : Return internal class of obj.
|
|
219
283
|
#
|
|
@@ -221,8 +285,12 @@ module ObjectSpace
|
|
|
221
285
|
#
|
|
222
286
|
# Note that you should not use this method in your application.
|
|
223
287
|
#
|
|
224
|
-
def self
|
|
288
|
+
def self?.internal_class_of: (untyped) -> Class
|
|
225
289
|
|
|
290
|
+
# <!--
|
|
291
|
+
# rdoc-file=ext/objspace/objspace.c
|
|
292
|
+
# - ObjectSpace.internal_super_of(cls) -> Class or Module
|
|
293
|
+
# -->
|
|
226
294
|
# MRI specific feature
|
|
227
295
|
# : Return internal super class of cls (Class or Module).
|
|
228
296
|
#
|
|
@@ -230,8 +298,12 @@ module ObjectSpace
|
|
|
230
298
|
#
|
|
231
299
|
# Note that you should not use this method in your application.
|
|
232
300
|
#
|
|
233
|
-
def self
|
|
301
|
+
def self?.internal_super_of: (untyped) -> untyped
|
|
234
302
|
|
|
303
|
+
# <!--
|
|
304
|
+
# rdoc-file=ext/objspace/objspace.c
|
|
305
|
+
# - ObjectSpace.memsize_of(obj) -> Integer
|
|
306
|
+
# -->
|
|
235
307
|
# Return consuming memory size of obj in bytes.
|
|
236
308
|
#
|
|
237
309
|
# Note that the return size is incomplete. You need to deal with this
|
|
@@ -242,8 +314,12 @@ module ObjectSpace
|
|
|
242
314
|
#
|
|
243
315
|
# From Ruby 2.2, memsize_of(obj) returns a memory size includes sizeof(RVALUE).
|
|
244
316
|
#
|
|
245
|
-
def self
|
|
317
|
+
def self?.memsize_of: (untyped) -> Integer
|
|
246
318
|
|
|
319
|
+
# <!--
|
|
320
|
+
# rdoc-file=ext/objspace/objspace.c
|
|
321
|
+
# - ObjectSpace.memsize_of_all([klass]) -> Integer
|
|
322
|
+
# -->
|
|
247
323
|
# Return consuming memory size of all living objects in bytes.
|
|
248
324
|
#
|
|
249
325
|
# If `klass` (should be Class object) is given, return the total memory size of
|
|
@@ -267,8 +343,12 @@ module ObjectSpace
|
|
|
267
343
|
#
|
|
268
344
|
# This method is only expected to work with C Ruby.
|
|
269
345
|
#
|
|
270
|
-
def self
|
|
346
|
+
def self?.memsize_of_all: (?Class) -> Integer
|
|
271
347
|
|
|
348
|
+
# <!--
|
|
349
|
+
# rdoc-file=ext/objspace/objspace.c
|
|
350
|
+
# - ObjectSpace.reachable_objects_from(obj) -> array or nil
|
|
351
|
+
# -->
|
|
272
352
|
# MRI specific feature
|
|
273
353
|
# : Return all reachable objects from `obj'.
|
|
274
354
|
#
|
|
@@ -307,14 +387,21 @@ module ObjectSpace
|
|
|
307
387
|
# ObjectSpace.reachable_objects_from(1)
|
|
308
388
|
# #=> nil # 1 is not markable (heap managed) object
|
|
309
389
|
#
|
|
310
|
-
def self
|
|
390
|
+
def self?.reachable_objects_from: (untyped) -> ([ untyped ] | nil)
|
|
311
391
|
|
|
392
|
+
# <!--
|
|
393
|
+
# rdoc-file=ext/objspace/objspace.c
|
|
394
|
+
# - ObjectSpace.reachable_objects_from_root -> hash
|
|
395
|
+
# -->
|
|
312
396
|
# MRI specific feature
|
|
313
397
|
# : Return all reachable objects from root.
|
|
314
398
|
#
|
|
315
|
-
|
|
316
|
-
def self.reachable_objects_from_root: () -> Hash[String, untyped]
|
|
399
|
+
def self?.reachable_objects_from_root: () -> Hash[String, untyped]
|
|
317
400
|
|
|
401
|
+
# <!--
|
|
402
|
+
# rdoc-file=ext/objspace/object_tracing.c
|
|
403
|
+
# - trace_object_allocations { block }
|
|
404
|
+
# -->
|
|
318
405
|
# Starts tracing object allocations from the ObjectSpace extension module.
|
|
319
406
|
#
|
|
320
407
|
# For example:
|
|
@@ -342,65 +429,37 @@ module ObjectSpace
|
|
|
342
429
|
#
|
|
343
430
|
def self.trace_object_allocations: () { (untyped) -> untyped } -> untyped
|
|
344
431
|
|
|
432
|
+
# <!--
|
|
433
|
+
# rdoc-file=ext/objspace/object_tracing.c
|
|
434
|
+
# - trace_object_allocations_clear
|
|
435
|
+
# -->
|
|
345
436
|
# Clear recorded tracing information.
|
|
346
437
|
#
|
|
347
|
-
def self
|
|
438
|
+
def self?.trace_object_allocations_clear: () -> void
|
|
348
439
|
|
|
349
|
-
|
|
440
|
+
# <!--
|
|
441
|
+
# rdoc-file=ext/objspace/object_tracing.c
|
|
442
|
+
# - trace_object_allocations_debug_start()
|
|
443
|
+
# -->
|
|
444
|
+
#
|
|
445
|
+
def self?.trace_object_allocations_debug_start: () -> void
|
|
350
446
|
|
|
447
|
+
# <!--
|
|
448
|
+
# rdoc-file=ext/objspace/object_tracing.c
|
|
449
|
+
# - trace_object_allocations_start
|
|
450
|
+
# -->
|
|
351
451
|
# Starts tracing object allocations.
|
|
352
452
|
#
|
|
353
|
-
def self
|
|
453
|
+
def self?.trace_object_allocations_start: () -> void
|
|
354
454
|
|
|
455
|
+
# <!--
|
|
456
|
+
# rdoc-file=ext/objspace/object_tracing.c
|
|
457
|
+
# - trace_object_allocations_stop
|
|
458
|
+
# -->
|
|
355
459
|
# Stop tracing object allocations.
|
|
356
460
|
#
|
|
357
461
|
# Note that if ::trace_object_allocations_start is called n-times, then tracing
|
|
358
462
|
# will stop after calling ::trace_object_allocations_stop n-times.
|
|
359
463
|
#
|
|
360
|
-
def self
|
|
361
|
-
|
|
362
|
-
private
|
|
363
|
-
|
|
364
|
-
# Dump the contents of a ruby object as JSON.
|
|
365
|
-
#
|
|
366
|
-
# This method is only expected to work with C Ruby. This is an experimental
|
|
367
|
-
# method and is subject to change. In particular, the function signature and
|
|
368
|
-
# output format are not guaranteed to be compatible in future versions of ruby.
|
|
369
|
-
#
|
|
370
|
-
def dump: (untyped obj, ?output: Symbol) -> (String|File|nil)
|
|
371
|
-
|
|
372
|
-
# Dump the contents of the ruby heap as JSON.
|
|
373
|
-
#
|
|
374
|
-
# *since* must be a non-negative integer or `nil`.
|
|
375
|
-
#
|
|
376
|
-
# If *since* is a positive integer, only objects of that generation and newer
|
|
377
|
-
# generations are dumped. The current generation can be accessed using
|
|
378
|
-
# GC::count.
|
|
379
|
-
#
|
|
380
|
-
# Objects that were allocated without object allocation tracing enabled are
|
|
381
|
-
# ignored. See ::trace_object_allocations for more information and examples.
|
|
382
|
-
#
|
|
383
|
-
# If *since* is omitted or is `nil`, all objects are dumped.
|
|
384
|
-
#
|
|
385
|
-
# This method is only expected to work with C Ruby. This is an experimental
|
|
386
|
-
# method and is subject to change. In particular, the function signature and
|
|
387
|
-
# output format are not guaranteed to be compatible in future versions of ruby.
|
|
388
|
-
#
|
|
389
|
-
def dump_all: (?since: (Integer|nil), ?full: boolish, ?output: Symbol) -> (String|File|nil)
|
|
390
|
-
|
|
391
|
-
def memsize_of: (untyped) -> Integer
|
|
392
|
-
|
|
393
|
-
def memsize_of_all: (?class) -> Integer
|
|
394
|
-
|
|
395
|
-
def reachable_objects_from: (untyped) -> ([ untyped ] | nil)
|
|
396
|
-
|
|
397
|
-
def reachable_objects_from_root: () -> Hash[String, untyped]
|
|
398
|
-
|
|
399
|
-
def trace_object_allocations_clear: () -> void
|
|
400
|
-
|
|
401
|
-
def trace_object_allocations_debug_start: () -> void
|
|
402
|
-
|
|
403
|
-
def trace_object_allocations_start: () -> void
|
|
404
|
-
|
|
405
|
-
def trace_object_allocations_stop: () -> void
|
|
464
|
+
def self?.trace_object_allocations_stop: () -> void
|
|
406
465
|
end
|