Core: Init memory on multiple threads.

Also init volatile at the same time for consistency.
This commit is contained in:
Unknown W. Brackets
2021-04-16 00:53:50 -07:00
parent 6ee944a0a6
commit 4f96169357
6 changed files with 18 additions and 12 deletions
+7
View File
@@ -133,3 +133,10 @@ void ThreadPool::ParallelMemcpy(void *dest, const void *src, int size) {
memmove((uint8_t *)dest + l, (const uint8_t *)src + l, h - l);
}, 0, size, MIN_SIZE);
}
void ThreadPool::ParallelMemset(void *dest, uint8_t val, int size) {
static const int MIN_SIZE = 128 * 1024;
ParallelLoop([&](int l, int h) {
memset((uint8_t *)dest + l, val, h - l);
}, 0, size, MIN_SIZE);
}