Function ralloc::realloc_inplace [] [src]

pub unsafe fn realloc_inplace(ptr: *mut u8,
                              old_size: usize,
                              size: usize)
                              -> Result<(), ()>

Try to reallocate the buffer inplace.

In case of success, return the new buffer's size. On failure, return the old size.

This can be used to shrink (truncate) a buffer as well.

Safety

Due to being able to shrink (and thus free) the buffer, this is marked unsafe.