about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-09-22 03:13:50 -0700
committerGitHub <noreply@github.com>2016-09-22 03:13:50 -0700
commitb2627b080a2cdf29dbabcecac89ecf80fa56ca63 (patch)
treea21e6e46361ea29a331f3faf779867a88a299716 /src/rustllvm/RustWrapper.cpp
parent6ad10844db51b950306d49070932562246e06616 (diff)
parent80a44779f7a211e075da9ed0ff2763afa00f43dc (diff)
downloadrust-b2627b080a2cdf29dbabcecac89ecf80fa56ca63.tar.gz
rust-b2627b080a2cdf29dbabcecac89ecf80fa56ca63.zip
Auto merge of #36592 - nnethercote:TypedArena, r=bluss
Lazily allocate TypedArena's first chunk

Currently `TypedArena` allocates its first chunk, which is usually 4096
bytes, as soon as it is created. If no allocations are ever made from
the arena then this allocation (and the corresponding deallocation) is
wasted effort.

This commit changes `TypedArena` so it doesn't allocate the first chunk
until the first allocation is made.

This change speeds up rustc by a non-trivial amount because rustc uses
`TypedArena` heavily: compilation speed (producing debug builds) on
several of the rustc-benchmarks increases by 1.02--1.06x. The change
should never cause a slow-down because the hot `alloc` function is
unchanged. It does increase the size of `TypedArena` by one `usize`
field, however.

The commit also fixes some out-of-date comments.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions