Browse Source

Allow debug context message in RingBuffer::commitWrite()

Signed-off-by: falkTX <falktx@falktx.com>
pull/506/head
falkTX 2 months ago
parent
commit
7c23fc79b4
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      distrho/extra/RingBuffer.hpp

+ 6
- 2
distrho/extra/RingBuffer.hpp View File

@@ -537,7 +537,7 @@ public:
* Commit all previous write operations to the ringbuffer.
* If a write operation has previously failed, this will reset/invalidate the previous write attempts.
*/
bool commitWrite() noexcept
bool commitWrite(const char* const debugMsg = nullptr) noexcept
{
DISTRHO_SAFE_ASSERT_RETURN(buffer != nullptr, false);

@@ -549,7 +549,11 @@ public:
}

// nothing to commit?
DISTRHO_SAFE_ASSERT_RETURN(buffer->head != buffer->wrtn, false);
if (debugMsg != nullptr) {
DISTRHO_CUSTOM_SAFE_ASSERT_RETURN(debugMsg, buffer->head != buffer->wrtn, false);
} else {
DISTRHO_SAFE_ASSERT_RETURN(buffer->head != buffer->wrtn, false);
}

// all ok
buffer->head = buffer->wrtn;


Loading…
Cancel
Save