This implements a simple buffer queue to manage a pre-allocated queue of
fixed-sized buffers to hold XRay records. We need this to support
Flight Data Recorder (FDR) mode. We also implement this as a sub-library
first to allow for development before actually using it in an
implementation.
Some important properties of the buffer queue:
- Thread-safe enqueueing/dequeueing of fixed-size buffers.
- Pre-allocation of buffers at construction.
Here and in the other places ASSERT_NE(Buffers.getBuffer(Buf), 0) would give more information in case the test fails: the error code would get into the report produced by gtest.
Forcing it to boolean producess less informative report:
http://lab.llvm.org:8011/builders/clang-native-aarch64-full/builds/100/steps/ninja%20check%202/logs/FAIL%3A%20XRay-Unit%3A%3ABufferQueueTest.GetAndRelease