Bug 1642542 - Make DebugOnly a variable used for checking an assert. r=padenot
authorAlex Chronopoulos <achronop@gmail.com>
Tue, 02 Jun 2020 12:07:02 +0000
changeset 533492 1f0a68ae0e283985314adc06a75ae0212e5b74a0
parent 533491 c39dfc8c9ef454f7482084337de9c6d6a3b64b92
child 533493 0cb7bdff1c002062079013bf931dc3839c1bb6cb
push id37473
push usercbrindusan@mozilla.com
push dateWed, 03 Jun 2020 04:20:58 +0000
treeherdermozilla-central@3609aa746c29 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1642542
milestone79.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1642542 - Make DebugOnly a variable used for checking an assert. r=padenot Differential Revision: https://phabricator.services.mozilla.com/D77783
dom/media/AudioRingBuffer.cpp
--- a/dom/media/AudioRingBuffer.cpp
+++ b/dom/media/AudioRingBuffer.cpp
@@ -98,17 +98,17 @@ class RingBuffer final {
     }
 
     int toWriteThis = std::min(AvailableWrite(), aSamples);
     int toReadThat = std::min(aBuffer.AvailableRead(), toWriteThis);
     int part1 = std::min(aBuffer.Capacity() - aBuffer.mReadIndex, toReadThat);
     int part2 = toReadThat - part1;
 
     Span<T> part1Buffer = aBuffer.mStorage.Subspan(aBuffer.mReadIndex, part1);
-    int ret = Write(part1Buffer);
+    DebugOnly<int> ret = Write(part1Buffer);
     MOZ_ASSERT(ret == part1);
     if (part2) {
       Span<T> part2Buffer = aBuffer.mStorage.To(part2);
       ret = Write(part2Buffer);
       MOZ_ASSERT(ret == part2);
     }
 
     return toReadThat;