Commit graph

8 commits

Author SHA1 Message Date
Daniel Sage
81caf1aae0
Rewrite & optimize LimitedQueue (#3798)
* Use circular buffer for LimitedQueue

* Reduce copying of snapshot

* Small optimizations

* Remove unneeded lock statements

* Add LimitedQueue tests

* Fix includes for limited queue benchmark

* Update CHANGELOG.md

* Use correct boost version iterators

* Use a shared_mutex to clarify reads and writes

* Update `find`/`rfind` to return the result as a boost::optional

* Use `[[nodiscard]]` where applicable

* Update comments

* Add a couple more doc comments

* Replace size with get

get is a safe (locked & checked) version of at

* Use std::vector in LimitedQueueSnapshot

* Update LimitedQueue benchmarks

* Add mutex guard to buffer accessors

We do not know whether T is an atomic type or not
so we can't safely say that we can copy the value
at a certain address of the buffer.

See https://stackoverflow.com/a/2252478

* Update doc comments, add first/last getters

* Make limit_ const

* Omit `else` if the if-case always returns

* Title case category comments

* Remove `at`

* Fix `get` comment

* Privatize/comment/lock property accessors

 - `limit` is now private
 - `space` is now private
 - `full` has been removed
 - `empty` now locks

* Remove `front` function

* Remove `back` method

* Add comment to `first`

* Add comment to `last`

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
2022-06-18 10:44:48 +00:00
fourtf
a268abfd4c Allow searching in LogsPopup 2019-09-04 00:29:58 +02:00
fourtf
5453c65f0f implemented pausing on hover 2018-11-03 21:26:57 +01:00
fourtf
e259b9e39f added brace wrapping after if and for 2018-10-21 13:43:02 +02:00
fourtf
f71ff08e68 changed to 80 max column 2018-08-06 21:17:03 +02:00
fourtf
280bb4cf8e Renamed private members 2018-07-06 19:24:35 +02:00
fourtf
2df0566492 removed namespaces 2018-06-26 16:37:59 +02:00
fourtf
c9722b9780 rename #2 2018-06-26 13:24:55 +02:00
Renamed from src/messages/_LimitedQueueSnapshot.hpp (Browse further)