Skip to content

Commit 70a3b29

Browse files
committed
Add comment about passing blocks in calls to C extensions.
1 parent 12dbac8 commit 70a3b29

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/truffle/truffle/cext_ruby.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ def rb_define_method(mod, name, function, argc)
3232
# Using raw execute instead of #call here to avoid argument conversion
3333
Truffle::CExt.push_preserving_frame
3434
begin
35+
# We must call explicitly with the block argument if given
36+
# here so that the `rb_block_*` functions will be able to find
37+
# it by walking the stack.
3538
if block
3639
Truffle::CExt.rb_tr_unwrap(Truffle::CExt.execute_with_mutex(function, *args, &block))
3740
else

0 commit comments

Comments
 (0)