This is a copy of the unstable allocator_api (https://github.com/rust-lang/rust/issues/32838)
Usable with stable rust, but requires 1.25.