admin管理员组

文章数量:1131217

I'm writing a microbenchmark to generate traffic to main memory (DRAM) using c++ and g++. I know I can inline assembly to create uncacheable accesses. However, I want this to operate on multiple systems (x86, ARM, RISC-V) and was wondering if g++ has the ability to mark a memory buffer as uncacheable?

I looked at malloc's documentation and it doesn't seem to let me pass any flags that mark a region as uncacheable (or, barring that, non-temporal).

I know the page tables in ARM at least allow a page that's allocated to have cacheability attributes. Does g++ have a way to portably try to make a memory region bypass cache?

本文标签: gccIn C is there a portable way to make uncacheable memory accessesStack Overflow