ruby/internal
Alan Wu 11e7ab79de
Remove 1 allocation in Enumerable#each_with_index (#11868)
* Remove 1 allocation in Enumerable#each_with_index

Previously, each call to Enumerable#each_with_index allocates 2
objects, one for the counting index, the other an imemo_ifunc passed
to `self.each` as a block.

Use `struct vm_ifunc::data` to hold the counting index directly to
remove 1 allocation.

* [DOC] Brief summary for usages of `struct vm_ifunc`
2024-10-11 10:22:44 -04:00
..
array.h
basic_operators.h
bignum.h
bits.h
class.h Rename size_pool -> heap 2024-10-03 21:20:09 +01:00
cmdlineopt.h
compar.h
compile.h
compilers.h
complex.h
cont.h
dir.h
enc.h
encoding.h
enum.h
enumerator.h
error.h
eval.h
file.h
fixnum.h `rb_fix_mul_fix` needs internal/bits.h for `MUL_OVERFLOW_FIXNUM_P` 2024-10-08 23:29:49 +09:00
gc.h Rename size_pool -> heap 2024-10-03 21:20:09 +01:00
hash.h Optimized instruction for Hash#freeze 2024-09-05 12:46:02 +02:00
imemo.h Remove 1 allocation in Enumerable#each_with_index (#11868) 2024-10-11 10:22:44 -04:00
inits.h
io.h Introduce `rb_io_blocking_region` which takes `struct rb_io` argument. (#11795) 2024-10-05 15:10:12 +13:00
load.h
loadpath.h
math.h
missing.h
numeric.h
object.h
parse.h Make default parser enum and define getter/setter 2024-10-02 20:43:40 +09:00
proc.h
process.h
ractor.h
random.h
range.h
rational.h
re.h
ruby_parser.h
sanitizers.h Fix extra semicolon outside of a function in `NO_SANITIZE` 2024-10-08 23:29:49 +09:00
serial.h
signal.h
st.h
static_assert.h
string.h Don't export unnecessary string functions 2024-09-16 14:38:49 -04:00
struct.h
symbol.h
thread.h Ensure fiber scheduler is woken up when close interrupts read 2024-09-17 10:11:44 +10:00
time.h
transcode.h
util.h
variable.h
vm.h Remove 1 allocation in Enumerable#each_with_index (#11868) 2024-10-11 10:22:44 -04:00
warnings.h