Moves data into the L1 cache with the intent to modify it.
Synopsis
Declared in <absl/base/prefetch.h>
void
PrefetchToLocalCacheForWrite(void const* addr);
Description
This function is similar to PrefetchToLocalCache() except that it prefetches cachelines with an 'intent to modify' This typically includes invalidating cache entries for this address in all other cache tiers, and an exclusive access intent.
Incorrect or gratuitous use of this function can degrade performance. As this function can invalidate cached cachelines on other caches and computer cores, incorrect usage of this function can have an even greater negative impact than incorrect regular prefetches. Use this function only when representative benchmarks show an improvement.
Example:
void* Arena::Allocate(size_t size) { void* ptr = AllocateBlock(size); absl::PrefetchToLocalCacheForWrite(ptr); return ptr; }
Parameters
Name |
Description |
addr |
The address of the memory to prefetch. |
Created with MrDocs