mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
Clear memory for newly allocated iseq
This commit is contained in:
parent
74075617b1
commit
42b6ec0149
7
iseq.h
7
iseq.h
@ -175,7 +175,12 @@ ISEQ_COMPILE_DATA_CLEAR(rb_iseq_t *iseq)
|
||||
static inline rb_iseq_t *
|
||||
iseq_imemo_alloc(void)
|
||||
{
|
||||
return IMEMO_NEW(rb_iseq_t, imemo_iseq, 0);
|
||||
rb_iseq_t *iseq = IMEMO_NEW(rb_iseq_t, imemo_iseq, 0);
|
||||
|
||||
// Clear out the whole iseq except for the flags.
|
||||
memset((char *)iseq + sizeof(VALUE), 0, sizeof(rb_iseq_t) - sizeof(VALUE));
|
||||
|
||||
return iseq;
|
||||
}
|
||||
|
||||
VALUE rb_iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user