about summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-06-16 11:48:57 -0700
committerbors <bors@rust-lang.org>2013-06-16 11:48:57 -0700
commit81506a6b819dbcef0893307becaba03edf5e4bbe (patch)
tree00760bfe813d0bfc4f73e338ec2b9c136f3af26e /src/rt/rust_task.cpp
parentfd8aa9afbd42cc6979c0b83690b32d27cc7afa78 (diff)
parent642cd467c6b49f50b42d833480b875ca5eb64e32 (diff)
downloadrust-81506a6b819dbcef0893307becaba03edf5e4bbe.tar.gz
rust-81506a6b819dbcef0893307becaba03edf5e4bbe.zip
auto merge of #7186 : dotdash/rust/landing_pads, r=pcwalton
Currently, cleanup blocks are only reused when there are nested scopes, the
child scope's cleanup block will terminate with a jump to the parent
scope's cleanup block. But within a single scope, adding or revoking
any cleanup will force a fresh cleanup block. This means quadratic
growth with the number of allocations in a scope, because each
allocation needs a landing pad.

Instead of forcing a fresh cleanup block, we can keep a list chained
cleanup blocks that form a prefix of the currently required cleanups.
That way, the next cleanup block only has to handle newly added
cleanups. And by keeping the whole list instead of just the latest
block, we can also handle revocations more efficiently, by only
dropping those blocks that are no longer required, instead of all of
them.

Reduces the size of librustc by about 5% and the time required to build
it by about 10%.
Diffstat (limited to 'src/rt/rust_task.cpp')
0 files changed, 0 insertions, 0 deletions