github.com/wencode/hack@v0.2.9/mmap/flush_amd64.go (about) 1 // +build amd64 2 3 package mmap 4 5 func flush_cache(addr, size uintptr) 6 7 const ( 8 cacheLineLength uintptr = 64 9 cacheLineMask uintptr = ^(cacheLineLength - 1) 10 ) 11 12 func Flush(addr, length uintptr) uintptr { 13 alignAddr := addr & cacheLineMask 14 length += (addr - alignAddr) 15 flush_cache(alignAddr, length) 16 return 0 17 }