From fa7bf880b4f351cd99978f7d096510aad137ca18 Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 10 Oct 2013 04:56:32 +0000 Subject: * vm_trace.c (postponed_job): use preallocated buffer. Pre-allocate MAX_POSTPONED_JOB (1024) sized buffer and use it. If rb_postponed_job_register() cause overflow, simply it fails and returns 0. And maybe rb_postponed_job_register() is signal safe. * vm_core.h: change data structure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_core.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'vm_core.h') diff --git a/vm_core.h b/vm_core.h index 4c6e3c250c..8510e1688a 100644 --- a/vm_core.h +++ b/vm_core.h @@ -389,7 +389,9 @@ typedef struct rb_vm_struct { /* hook */ rb_hook_list_t event_hooks; - struct rb_postponed_job_struct *postponed_job; + /* postponed_job */ + struct rb_postponed_job_struct *postponed_job_buffer; + int postponed_job_index; int src_encoding_index; -- cgit v1.2.3