diff options
author | Lourens Naudé <lourens@bearmetal.eu> | 2019-10-22 00:03:05 +0100 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-10-29 11:32:09 +0900 |
commit | fecaa6e946fc87df28682c96fea67c1535825cd5 (patch) | |
tree | 4576aac5da3d2fc3183836bd1c10f6a07037720f /vm_backtrace.c | |
parent | 0095362918375fb694345133e33199b01911e594 (diff) |
Let the backtrace array constructed in backtrace_collect be initialized with the size already given
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2593
Diffstat (limited to 'vm_backtrace.c')
-rw-r--r-- | vm_backtrace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vm_backtrace.c b/vm_backtrace.c index b04f6dac31..5b79e3d274 100644 --- a/vm_backtrace.c +++ b/vm_backtrace.c @@ -578,7 +578,7 @@ backtrace_collect(rb_backtrace_t *bt, long lev, long n, VALUE (*func)(rb_backtra rb_bug("backtrace_collect: unreachable"); } - btary = rb_ary_new(); + btary = rb_ary_new2(n); for (i=0; i+lev<bt->backtrace_size && i<n; i++) { rb_backtrace_location_t *loc = &bt->backtrace[bt->backtrace_size - 1 - (lev+i)]; |