Remove null check from heap::deallocate
I added this to get DST landed. For ~[T] types I use a {ptr, len} fat pointer. If the vector is empy I use null for the pointer, so when this deallocates via drop glue jemalloc segfaults. It should be fairly easy to do a zero sized allocation or something and use that value and then we can remove the null check. That also allows us to use the Option to non-null pointer optimisation. For now I just want to get this branch landed though.
cc @thestinger, @alexcrichton
FWIW,
Vecuses1 as *Tas the sentinel value for this sort of situation (to ensure thatOption<...>still works, since that uses the "non-null" pointer as the discriminant).Huon Wilson at 2014-05-24 06:06:24
@nick29581: It seems that @luqmana landed the non-null pointer optimization for slices so this shouldn't be required anymore. Can it be closed?
Daniel Micay at 2014-07-11 16:20:03
This ended up landing as part of the initial implementation, but I don't think it is actually accomplishing anything.
Daniel Micay at 2014-09-08 05:51:10