Skip to content

Commit e34dbcf

Browse files
authored
Merge pull request #2779 from ruby/pz-remove-objspace-count-nodes
Remove ObjectSpace.count_nodes
2 parents fdfffb3 + 50cb7f0 commit e34dbcf

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

stdlib/objspace/0/objspace.rbs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -126,29 +126,6 @@ module ObjectSpace
126126
#
127127
def self?.count_imemo_objects: (?Hash[Symbol, Integer] result_hash) -> Hash[Symbol, Integer]
128128

129-
# <!--
130-
# rdoc-file=ext/objspace/objspace.c
131-
# - ObjectSpace.count_nodes([result_hash]) -> hash
132-
# -->
133-
# Counts nodes for each node type.
134-
#
135-
# This method is only for MRI developers interested in performance and memory
136-
# usage of Ruby programs.
137-
#
138-
# It returns a hash as:
139-
#
140-
# {:NODE_METHOD=>2027, :NODE_FBODY=>1927, :NODE_CFUNC=>1798, ...}
141-
#
142-
# If the optional argument, result_hash, is given, it is overwritten and
143-
# returned. This is intended to avoid probe effect.
144-
#
145-
# Note: The contents of the returned hash is implementation defined. It may be
146-
# changed in future.
147-
#
148-
# This method is only expected to work with C Ruby.
149-
#
150-
def self?.count_nodes: (?Hash[Symbol, Integer] result_hash) -> Hash[Symbol, Integer]
151-
152129
# <!--
153130
# rdoc-file=ext/objspace/objspace.c
154131
# - ObjectSpace.count_objects_size([result_hash]) -> hash

test/stdlib/ObjectSpace_test.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,6 @@ def test_count_imemo_objects
9999
ObjectSpace, :count_imemo_objects, { TOTAL: 0 }
100100
end
101101

102-
def test_count_nodes
103-
ObjectSpace::trace_object_allocations do
104-
assert_send_type "() -> Hash[Symbol, Integer]",
105-
ObjectSpace, :count_nodes
106-
assert_send_type "(Hash[Symbol, Integer]) -> Hash[Symbol, Integer]",
107-
ObjectSpace, :count_nodes, {}
108-
assert_send_type "(Hash[Symbol, Integer]) -> Hash[Symbol, Integer]",
109-
ObjectSpace, :count_nodes, { TOTAL: 0 }
110-
end
111-
end
112-
113102
def test_count_objects_size
114103
assert_send_type "() -> Hash[Symbol, Integer]",
115104
ObjectSpace, :count_objects_size

0 commit comments

Comments
 (0)