reallocate() copies old values to new buffer.