I'm not familiar enough with D to answer that.

In C, using malloc and friends, it's probably not possible.
You give up on either in place reallocation or unnecessary copying.

In the WinAPI, HeapReAlloc has the parameter HEAP_REALLOC_IN_PLACE_ONLY which can be used.