buffer: tell realloc to not copy the old content

buffer_set_size() reinitializes the buffer object to empty
state by a call to buffer_init(), so no point in copying
the old content in rbrealloc.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
This commit is contained in:
Marcin Maka 2020-04-06 19:10:18 +02:00 committed by Liam Girdwood
parent 370b118c04
commit 717e8395a3
1 changed files with 2 additions and 2 deletions

View File

@ -99,8 +99,8 @@ int buffer_set_size(struct comp_buffer *buffer, uint32_t size)
if (size == buffer->stream.size)
return 0;
new_ptr = rbrealloc(buffer->stream.addr, 0, buffer->caps, size,
buffer->stream.size);
new_ptr = rbrealloc(buffer->stream.addr, SOF_MEM_FLAG_NO_COPY,
buffer->caps, size, buffer->stream.size);
/* we couldn't allocate bigger chunk */
if (!new_ptr && size > buffer->stream.size) {