about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-09-13 20:36:02 +0000
committerbors <bors@rust-lang.org>2014-09-13 20:36:02 +0000
commit79a5448f41dcc6ab52663105a6b02fc5af4c503e (patch)
tree3cbc563de1bf23fc598bfe078e24333724bd7f92 /src/liballoc
parent7277fe9ee790a5f2fe2131b62a21537ac04e4cfd (diff)
parent0fc06b14c5fcbf6efb26c48c9d396e63dca02946 (diff)
downloadrust-79a5448f41dcc6ab52663105a6b02fc5af4c503e.tar.gz
rust-79a5448f41dcc6ab52663105a6b02fc5af4c503e.zip
auto merge of #17188 : thestinger/rust/tvec, r=pcwalton
`Box<[T]>` is created by allocating `Box<[T, ..n]>` and coercing it so
this code path is never used. It's also broken because it clamps the
capacity of the memory allocations to 4 elements and that's incompatible
with sized deallocation. This dates back to when `~[T]` was a growable
vector type implemented as:

*{ { tydesc, ref_count, prev, next }, { length, capacity, data[] } }

Since even empty vectors had to allocate, it started off the capacity of
all vectors at 4 as a heuristic. It's not possible to grow `Box<[T]>`
and there is no need for a memory allocation when it's empty, so it
would be a terrible heuristic today even if it worked.
Diffstat (limited to 'src/liballoc')
0 files changed, 0 insertions, 0 deletions