1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

Thread loops done properly

This commit is contained in:
paboyle 2018-01-24 13:49:39 +00:00
parent 408b868475
commit 65f77112e0

View File

@ -169,9 +169,9 @@ public:
// std::cout << "alignedAllocator " << std::hex << ptr <<std::dec <<std::endl;
// First touch optimise in threaded loop
uint8_t *cp = (uint8_t *)ptr;
thread_loop(size_type n=0;n<bytes;n+=4096){
thread_loop( (size_type n=0;n<bytes;n+=4096) , {
cp[n]=0;
}
});
return ptr;
}
@ -274,9 +274,9 @@ public:
uint8_t *cp = (uint8_t *)ptr;
if ( ptr ) {
// One touch per 4k page, static OMP loop to catch same loop order
thread_loop(size_type n=0;n<bytes;n+=4096){
thread_loop( (size_type n=0;n<bytes;n+=4096),{
cp[n]=0;
}
});
}
return ptr;
}