Common: Set a min size on threadpool work chunks.

This should avoid slicing loops, etc. into too many chunks.  Generalize
the memcpy a bit.
This commit is contained in:
Unknown W. Brackets committed 2021-04-15 23:59:02 -07:00
1 parent 639dd67130
commit b2f3f06768
5 files changed
+48 -45

No files matched your search

+2 -6
View File
@@ -324,14 +324,10 @@ static void DoMemoryVoid(PointerWrap &p, uint32_t start, uint32_t size) {
switch (p.mode) {
case PointerWrap::MODE_READ:
GlobalThreadPool::Loop([&](int l, int h) {
memmove(d + l, storage + l, h - l);
}, 0, size);
GlobalThreadPool::Memcpy(d, storage, size);
break;
case PointerWrap::MODE_WRITE:
GlobalThreadPool::Loop([&](int l, int h) {
memmove(storage + l, d + l, h - l);
}, 0, size);
GlobalThreadPool::Memcpy(storage, d, size);
break;
case PointerWrap::MODE_MEASURE:
// Nothing to do here.