Skip to content

Commit 9490a8a

Browse files
committed
SingleBuffer: allocator support
1 parent 40e7cfc commit 9490a8a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/AudioTools/CoreAudio/Buffers.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ class SingleBuffer : public BaseBuffer<T> {
176176
*
177177
* @param size in entries
178178
*/
179-
SingleBuffer(int size) {
179+
SingleBuffer(int size, Allocator &allocator = DefaultAllocator)
180+
: _allocator(allocator) {
180181
buffer.resize(size);
181182
reset();
182183
}
@@ -323,11 +324,12 @@ class SingleBuffer : public BaseBuffer<T> {
323324
uint64_t timestamp = 0;
324325

325326
protected:
327+
Allocator _allocator;
326328
int current_read_pos = 0;
327329
int current_write_pos = 0;
328330
bool owns_buffer = true;
329331
bool is_clear_with_zero = false;
330-
Vector<T> buffer{0};
332+
Vector<T> buffer{0, _allocator};
331333
};
332334

333335
/**

0 commit comments

Comments
 (0)