MCPcopy
hub / github.com/uber/aresdb / MemEqual

Function MemEqual

utils/memory.go:30–37  ·  view source on GitHub ↗

MemEqual performs byte to byte comparison.

(a unsafe.Pointer, b unsafe.Pointer, bytes int)

Source from the content-addressed store, hash-verified

28
29// MemEqual performs byte to byte comparison.
30func MemEqual(a unsafe.Pointer, b unsafe.Pointer, bytes int) bool {
31 for i := 0; i < bytes; i++ {
32 if *(*uint8)(MemAccess(a, i)) != *(*uint8)(MemAccess(b, i)) {
33 return false
34 }
35 }
36 return true
37}
38
39// MemCopy performs memory copy of specified bytes from src to dst
40func MemCopy(dst unsafe.Pointer, src unsafe.Pointer, bytes int) {

Callers 6

UpdateMethod · 0.92
FindMethod · 0.92
DeleteMethod · 0.92
findOrAddNewMethod · 0.92
BenchmarkMemEqualFunction · 0.85
memory_test.goFile · 0.85

Calls 1

MemAccessFunction · 0.85

Tested by 1

BenchmarkMemEqualFunction · 0.68