summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/iseq.c b/iseq.c
index 7fbb906525f..4298130b655 100644
--- a/iseq.c
+++ b/iseq.c
@@ -427,11 +427,22 @@ rb_iseq_memsize(const rb_iseq_t *iseq)
return size;
}
+static unsigned long fresh_iseq_unique_id = 0; /* -- Remove In 3.0 -- */
+
+struct rb_iseq_constant_body *
+rb_iseq_constant_body_alloc(void)
+{
+ struct rb_iseq_constant_body *iseq_body;
+ iseq_body = ZALLOC(struct rb_iseq_constant_body);
+ iseq_body->iseq_unique_id = fresh_iseq_unique_id++; /* -- Remove In 3.0 -- */
+ return iseq_body;
+}
+
static rb_iseq_t *
iseq_alloc(void)
{
rb_iseq_t *iseq = iseq_imemo_alloc();
- iseq->body = ZALLOC(struct rb_iseq_constant_body);
+ iseq->body = rb_iseq_constant_body_alloc();
return iseq;
}