Skip to content

Commit 6c7fdd7

Browse files
committed
Change arg of rb_gc_register_address and rb_gc_unregister_address to in_ref
1 parent 263fc5c commit 6c7fdd7

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

config/default.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ function:
110110
4: array
111111
rb_funcallv_public:
112112
4: array
113+
rb_gc_register_address:
114+
1: in_ref
115+
rb_gc_unregister_address:
116+
1: in_ref
113117
rb_get_values_at:
114118
5: function
115119
rb_glob:

spec/ruby_header_parser/parser_spec.rb

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,36 @@
201201
its(:typeref) { should eq typeref(type: "void") }
202202
its(:args) { should eq args }
203203
end
204+
205+
context "rb_gc_register_address" do
206+
subject { definitions.find { |d| d.name == "rb_gc_register_address" } }
207+
208+
let(:args) do
209+
[
210+
argument(type: "VALUE", name: "valptr", pointer: :in_ref),
211+
]
212+
end
213+
214+
its(:name) { should eq "rb_gc_register_address" }
215+
its(:definition) { should eq "void rb_gc_register_address(VALUE *valptr)" }
216+
its(:typeref) { should eq typeref(type: "void") }
217+
its(:args) { should eq args }
218+
end
219+
220+
context "rb_gc_unregister_address" do
221+
subject { definitions.find { |d| d.name == "rb_gc_unregister_address" } }
222+
223+
let(:args) do
224+
[
225+
argument(type: "VALUE", name: "valptr", pointer: :in_ref),
226+
]
227+
end
228+
229+
its(:name) { should eq "rb_gc_unregister_address" }
230+
its(:definition) { should eq "void rb_gc_unregister_address(VALUE *valptr)" }
231+
its(:typeref) { should eq typeref(type: "void") }
232+
its(:args) { should eq args }
233+
end
204234
end
205235

206236
describe "#extract_static_inline_function_definitions" do

0 commit comments

Comments
 (0)