* 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
This commit is contained in:
parent
308d5d0cf3
commit
a1b1b6f7fb
@ -1,3 +1,8 @@
|
||||
Mon May 27 16:16:18 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* vm_trace.c (rb_postponed_job_flush, rb_postponed_job_register): use
|
||||
ruby_xmalloc/xfree. It is safe during GC.
|
||||
|
||||
Mon May 27 09:24:03 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* test/-ext-/postponed_job/test_postponed_job.rb: fix typo and class name.
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user