fix reallocation/copy sizes for direct index and blob pool
This commit is contained in:
parent
604fc35e16
commit
5c0fd05c52
@ -72,7 +72,7 @@ RTMidiBuffer::resize (size_t size)
|
|||||||
cache_aligned_malloc ((void**) &_data, size * sizeof (Item));
|
cache_aligned_malloc ((void**) &_data, size * sizeof (Item));
|
||||||
|
|
||||||
if (_size) {
|
if (_size) {
|
||||||
memcpy (_data, old_data, _size);
|
memcpy (_data, old_data, _size * sizeof (Item));
|
||||||
cache_aligned_free (old_data);
|
cache_aligned_free (old_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,8 +248,8 @@ RTMidiBuffer::alloc_blob (uint32_t size)
|
|||||||
|
|
||||||
_pool_capacity += size * 4;
|
_pool_capacity += size * 4;
|
||||||
|
|
||||||
cache_aligned_malloc ((void **) &_pool, _pool_capacity * 2);
|
cache_aligned_malloc ((void **) &_pool, (_pool_capacity * sizeof (Blob)));
|
||||||
memcpy (_pool, old_pool, _pool_size);
|
memcpy (_pool, old_pool, _pool_size * sizeof (Blob));
|
||||||
cache_aligned_free (old_pool);
|
cache_aligned_free (old_pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user