summaryrefslogtreecommitdiff
path: root/vm_trace.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-27 07:17:30 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-27 07:17:30 +0000
commita1b1b6f7fb22fddcb7843a021e16553f96aea137 (patch)
tree11bcfa1bc8d03498972f0332547469b0538870a3 /vm_trace.c
parent308d5d0cf3e11a529a55669c7b54d04e5e3fb1af (diff)
* 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
Diffstat (limited to 'vm_trace.c')
-rw-r--r--vm_trace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm_trace.c b/vm_trace.c
index 9c77153..7598806 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;
}
}