diff options
author | Peter Zhu <peter@peterzhu.ca> | 2022-03-23 15:19:48 -0400 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2022-03-24 10:03:51 -0400 |
commit | 5f10bd634fb6ae8f74a4ea730176233b0ca96954 (patch) | |
tree | 170c1c81ea63184290c9e021cc45bffbfc3f4f41 /vm_core.h | |
parent | 04591e1be7618f64bd3bed8c53c0fcde5fcbddb8 (diff) |
Add ISEQ_BODY macro
Use ISEQ_BODY macro to get the rb_iseq_constant_body of the ISeq. Using
this macro will make it easier for us to change the allocation strategy
of rb_iseq_constant_body when using Variable Width Allocation.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5698
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -522,6 +522,8 @@ struct rb_iseq_struct { } aux; }; +#define ISEQ_BODY(iseq) ((iseq)->body) + #ifndef USE_LAZY_LOAD #define USE_LAZY_LOAD 0 #endif @@ -534,7 +536,7 @@ static inline const rb_iseq_t * rb_iseq_check(const rb_iseq_t *iseq) { #if USE_LAZY_LOAD - if (iseq->body == NULL) { + if (ISEQ_BODY(iseq) == NULL) { rb_iseq_complete((rb_iseq_t *)iseq); } #endif |