summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2022-06-23 15:46:53 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2022-06-23 16:52:00 -0700
commit8d63a0470392f3b5810941bdf36f23d2122df16a (patch)
tree73870c66a57f66427db06c96d2fa8a5d6383851c /vm_core.h
parenteb1a84a9c328acf3f77249617115208eacf396cd (diff)
Flatten bitmap when there is only one element
We can avoid allocating a bitmap when the number of elements in the iseq is fewer than the size of an iseq_bits_t
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6058
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/vm_core.h b/vm_core.h
index 5a6643674a..b7d980e0ec 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -465,7 +465,10 @@ struct rb_iseq_constant_body {
unsigned int ivc_size; // Number of IVC and ICVARC caches
unsigned int ci_size;
unsigned int stack_max; /* for stack overflow check */
- iseq_bits_t * mark_offset_bits; /* Find references for GC */
+ union {
+ iseq_bits_t * list; /* Find references for GC */
+ iseq_bits_t single;
+ } mark_bits;
char catch_except_p; /* If a frame of this ISeq may catch exception, set TRUE */
// If true, this ISeq is leaf *and* backtraces are not used, for example,