mirror of https://github.com/thesofproject/sof.git
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:
parent
370b118c04
commit
717e8395a3
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue