[#absl-PrefetchToLocalCacheNta] = xref:absl.adoc[absl]::PrefetchToLocalCacheNta :relfileprefix: ../ :mrdocs: Moves data into the L1 cache before it is read, or "prefetches" it. == Synopsis Declared in `<absl/base/prefetch.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void PrefetchToLocalCacheNta(void const* addr); ---- == Description This function is identical to `PrefetchToLocalCache()` except that it has non‐temporal locality: the fetched data should not be left in any of the cache tiers. This is useful for cases where the data is used only once / short term, for example, invoking a destructor on an object. Incorrect or gratuitous use of this function can degrade performance. Use this function only when representative benchmarks show an improvement. Example: template <typename Iterator> void DestroyPointers(Iterator begin, Iterator end) { size_t distance = std::min(8U, bars.size()); int dist = 8; auto prefetch_it = begin; while (prefetch_it != end && ‐‐dist;) { absl::PrefetchToLocalCacheNta(*prefetch_it++); } while (prefetch_it != end) { delete *begin++; absl::PrefetchToLocalCacheNta(*prefetch_it++); } while (begin != end) { delete *begin++; } } == Parameters [cols="1,4"] |=== | Name| Description | *addr* | The address of the memory to prefetch. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#