Add prefetch to mpscq.
This commit is contained in:
@@ -136,6 +136,15 @@ namespace snmalloc
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void prefetch(void* ptr)
|
||||
{
|
||||
#if defined(PLATFORM_IS_X86)
|
||||
_mm_prefetch(reinterpret_cast<const char *>(ptr), _MM_HINT_T0);
|
||||
#else
|
||||
# warning "Missing pause intrinsic"
|
||||
#endif
|
||||
}
|
||||
|
||||
inline uint64_t tick()
|
||||
{
|
||||
#if defined(PLATFORM_IS_X86)
|
||||
|
||||
@@ -71,6 +71,7 @@ namespace snmalloc
|
||||
if (next != nullptr)
|
||||
{
|
||||
front = next;
|
||||
bits::prefetch(&(next->next));
|
||||
assert(front);
|
||||
std::atomic_thread_fence(std::memory_order_acquire);
|
||||
invariant();
|
||||
|
||||
Reference in New Issue
Block a user