+3
−2
+1
−0
system/osi/include/leaky_bonded_queue.h
0 → 100644
+158
−0
+242
−0
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
* 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 Change-Id: I51cb73666ac58e4792d9cba0d6f16dad30a0ff39