add `reallocate` and `reallocate_inplace`