code: Use std::span where appropriate (#6658)

* code: Use std::span when possible

* code: Prefix memcpy and memcmp with std::
This commit is contained in:
GPUCode 2023-07-07 01:52:40 +03:00 committed by GitHub
parent 4ccd9f24fb
commit cf9bb90ae3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
106 changed files with 362 additions and 329 deletions

View file

@ -304,7 +304,7 @@ void ThreadManager::DebugThreadQueue() {
* alloc_needed: Whether there's a need to allocate a new TLS page (All pages are full).
*/
static std::tuple<std::size_t, std::size_t, bool> GetFreeThreadLocalSlot(
const std::vector<std::bitset<8>>& tls_slots) {
std::span<const std::bitset<8>> tls_slots) {
// Iterate over all the allocated pages, and try to find one where not all slots are used.
for (std::size_t page = 0; page < tls_slots.size(); ++page) {
const auto& page_tls_slots = tls_slots[page];
@ -527,7 +527,7 @@ ThreadManager::~ThreadManager() {
}
}
const std::vector<std::shared_ptr<Thread>>& ThreadManager::GetThreadList() {
std::span<const std::shared_ptr<Thread>> ThreadManager::GetThreadList() {
return thread_list;
}