No. The header comes from size_of::<Vec<()>>. This is the same code used
for overflow handling elsewhere. cc @thestinger


On Mon, Nov 11, 2013 at 6:23 AM, Huon Wilson <notifications@github.com>wrote:

> In src/libstd/vec.rs:
>
> > @@ -186,7 +186,11 @@ pub fn with_capacity<T>(capacity: uint) -> ~[T] {
> >              vec
> >          } else {
> >              let alloc = capacity * mem::nonzero_size_of::<T>();
> > -            let ptr = malloc_raw(alloc + mem::size_of::<Vec<()>>()) as *mut Vec<()>;
> > +            let size = alloc + mem::size_of::<Vec<()>>();
> > +            if alloc / mem::nonzero_size_of::<T>() != capacity || size < alloc {
>
> Isn't this check incorrect, because the header is included in alloc?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/mozilla/rust/pull/10417/files#r7556668>
> .
>