summaryrefslogtreecommitdiffstats
path: root/src/common/ring_buffer.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-12-25ring_buffer: Use feature macroFearlessTobi1-1/+1
Co-Authored-By: GPUCode <47210458+GPUCode@users.noreply.github.com>
2023-06-30ring_buffer: Fix const usage on std::spanMorph1-1/+1
2023-06-22Remove memory allocations in some hot pathsKelebek11-1/+2
2022-04-23general: Convert source file copyright comments over to SPDXMorph1-3/+2
This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-03-19common: Reduce unused includesameerj1-1/+0
2021-02-06ring_buffer: Remove granularity template argumentMerryMage1-11/+10
Non-obvious bug in RingBuffer::Push(std::vector<T>&) when granularity != 1 Just remove it altogether because we do not have a use for granularity != 1
2020-08-15common: Make use of [[nodiscard]] where applicableLioncash1-2/+2
Now that clang-format makes [[nodiscard]] attributes format sensibly, we can apply them to several functions within the common library to allow the compiler to complain about any misuses of the functions.
2018-09-19ring_buffer: Use std::atomic_size_t in a static assertLioncash1-1/+1
Avoids the need to repeat "std::" twice
2018-09-19ring_buffer: Use std::hardware_destructive_interference_size to determine alignment size for avoiding false sharingLioncash1-2/+10
MSVC 19.11 (A.K.A. VS 15.3)'s C++ standard library implements P0154R1 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0154r1.html) which defines two new constants within the <new> header, std::hardware_destructive_interference_size and std::hardware_constructive_interference_size. std::hardware_destructive_interference_size defines the minimum recommended offset between two concurrently-accessed objects to avoid performance degradation due to contention introduced by the implementation (with the lower-bound being at least alignof(max_align_t)). In other words, the minimum offset between objects necessary to avoid false-sharing. std::hardware_constructive_interference_size on the other hand defines the maximum recommended size of contiguous memory occupied by two objects accessed wth temporal locality by concurrent threads (also defined to be at least alignof(max_align_t)). In other words the maximum size to promote true-sharing. So we can simply use this facility to determine the ideal alignment size. Unfortunately, only MSVC supports this right now, so we need to enclose it within an ifdef for the time being.
2018-09-15Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi1-25/+25
2018-09-08common: Implement a ring bufferMerryMage1-0/+111