Add LeakyBondedQueue to libosi
* LeakyBondedQueue is a fixed size queue that leaks oldest item when reaching its capacity. This is useful in creating memory bonded data structure where freshness is more important than full coverage. * The queue is protected by a simple mutex and is thread-safe, although improvements could be made to lock enqueue and dequeue separately, it is not implemented at this moment due to lack of demand * The queue uses unique_ptr to automatically free its content when it is destructed * Add several tests to verify its API and memory management * This data structure will be firstly used in the metrics module Bug: 33781460 Test: Code compilation, unit tests Merged-In: I51cb73666ac58e4792d9cba0d6f16dad30a0ff39 Change-Id: I51cb73666ac58e4792d9cba0d6f16dad30a0ff39 (cherry picked from commit 4ad0b2ba)
Loading
Please register or sign in to comment