about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2014-09-12 03:08:48 -0400
committerDaniel Micay <danielmicay@gmail.com>2014-09-12 03:37:20 -0400
commit0fc06b14c5fcbf6efb26c48c9d396e63dca02946 (patch)
tree14fb96c5e201faf2ed4826029fb731838cfc83c1 /src/liballoc
parent06c0b1d28ac28ca42d6c179293e333a012a8a3fc (diff)
downloadrust-0fc06b14c5fcbf6efb26c48c9d396e63dca02946.tar.gz
rust-0fc06b14c5fcbf6efb26c48c9d396e63dca02946.zip
remove dead and broken tvec ~[T] code path
`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