summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorYusuke Endoh <[email protected]>2024-07-09 18:27:02 +0900
committerYusuke Endoh <[email protected]>2024-07-10 13:00:47 +0900
commit114e32b35796ca546f429ee3295607a127d7e519 (patch)
tree2b733b36a8a32ca043708ed47a1c9c2f5b3d078c /proc.c
parent77b12a8aaf40678dd6cfea29ae27b92b3718ae0a (diff)
Add rb_block_call2, a flexible variant of rb_block_call
This function accepts flags: RB_NO_KEYWORDS, RB_PASS_KEYWORDS, RB_PASS_CALLED_KEYWORDS: Works as the same as rb_block_call_kw. RB_BLOCK_NO_USE_PACKED_ARGS: The given block ("bl_proc") does not use "yielded_arg" of rb_block_call_func_t. Instead, the block accesses the yielded arguments via "argc" and "argv". This flag allows the called method to yield arguments without allocating an Array.
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/proc.c b/proc.c
index 09b288fecd..fd1edb2bdc 100644
--- a/proc.c
+++ b/proc.c
@@ -1159,6 +1159,12 @@ rb_block_pair_yield_optimizable(void)
return min > 1;
}
+ case block_handler_type_ifunc:
+ {
+ const struct vm_ifunc *ifunc = block.as.captured.code.ifunc;
+ if (ifunc->flags & IFUNC_YIELD_OPTIMIZABLE) return 1;
+ }
+
default:
return min > 1;
}