[#absl-PrefetchToLocalCacheForWrite] = xref:absl.adoc[absl]::PrefetchToLocalCacheForWrite :relfileprefix: ../ :mrdocs: Moves data into the L1 cache with the intent to modify it. == Synopsis Declared in `<absl/base/prefetch.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- 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 [cols="1,4"] |=== | Name| Description | *addr* | The address of the memory to prefetch. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#