This commit is contained in:
Matthew Parkinson
2019-07-02 14:58:13 +01:00
parent eb4e28e8d0
commit b74116e209
3 changed files with 7 additions and 5 deletions

View File

@@ -133,9 +133,9 @@ namespace snmalloc
inline void prefetch(void* ptr)
{
#if defined(PLATFORM_IS_X86)
_mm_prefetch(reinterpret_cast<const char *>(ptr), _MM_HINT_T0);
_mm_prefetch(reinterpret_cast<const char*>(ptr), _MM_HINT_T0);
#else
# warning "Missing pause intrinsic"
# warning "Missing prefetch intrinsic"
#endif
}

View File

@@ -837,8 +837,10 @@ namespace snmalloc
{
// Manufacture an allocation to prime the queue
// Using an actual allocation removes a conditional of a critical path.
message_queue().init(
reinterpret_cast<Remote*>(alloc<YesZero>(MIN_ALLOC_SIZE)));
Remote* remote =
reinterpret_cast<Remote*>(alloc<YesZero>(MIN_ALLOC_SIZE));
remote->set_target_id(id());
message_queue().init(remote);
}
SNMALLOC_FAST_PATH void handle_dealloc_remote(Remote* p)

View File

@@ -104,7 +104,7 @@ namespace snmalloc
return sizeclass_metadata.cache_friendly_mask[sizeclass];
}
constexpr static inline size_t
constexpr static SNMALLOC_FAST_PATH size_t
sizeclass_to_inverse_cache_friendly_mask(sizeclass_t sizeclass)
{
return sizeclass_metadata.inverse_cache_friendly_mask[sizeclass];