From a1b1b6f7fb22fddcb7843a021e16553f96aea137 Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 27 May 2013 07:17:30 +0000 Subject: * vm_trace.c (rb_postponed_job_flush, rb_postponed_job_register): use ruby_xmalloc/xfree. It is safe during GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_trace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vm_trace.c') diff --git a/vm_trace.c b/vm_trace.c index 9c77153c3e..75988060fd 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -1390,7 +1390,7 @@ rb_postponed_job_register(unsigned int flags, rb_postponed_job_func_t func, void { rb_thread_t *th = GET_THREAD(); rb_vm_t *vm = th->vm; - rb_postponed_job_t *pjob = (rb_postponed_job_t *)malloc(sizeof(rb_postponed_job_t)); /* postponed_job should be separated with Ruby's GC */ + rb_postponed_job_t *pjob = (rb_postponed_job_t *)ruby_xmalloc(sizeof(rb_postponed_job_t)); if (pjob == NULL) return 0; /* failed */ pjob->flags = flags; @@ -1429,7 +1429,7 @@ rb_postponed_job_flush(rb_vm_t *vm) while (pjob) { next_pjob = pjob->next; pjob->func(pjob->data); - free(pjob); /* postponed_job should be separated with Ruby's GC */ + ruby_xfree(pjob); /* postponed_job should be separated with Ruby's GC */ pjob = next_pjob; } } -- cgit v1.2.3