From 93e74aaf914f5865a5e92e6cb679fbf810b241f8 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 4 Feb 2026 14:18:08 +1000 Subject: [PATCH] Reduce the size of the `ma_device_op_queue` struct. This in turn reduces the size of the `ma_device` struct by about half a kilobyte or so. --- miniaudio.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/miniaudio.h b/miniaudio.h index e7da97f3..0de51ccb 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -7450,6 +7450,9 @@ typedef struct ma_device_op /* The device op queue is just a simple list with a mutex for the time being while I get everything set up. Might make this more efficient later. + +The capacity of this queue is tiny. In practice it's rare that there would be more than one item in the queue because +typically a init/uninit/start/stop will typically be done in an orderly and synchronous manner. */ typedef struct ma_device_op_queue { @@ -7459,7 +7462,7 @@ typedef struct ma_device_op_queue #endif ma_uint32 count; ma_uint32 tail; - ma_device_op pItems[16]; + ma_device_op pItems[4]; /* In practice, a capacity of 4 should be more than enough. */ } ma_device_op_queue;