MCPcopy
hub / github.com/cilium/ebpf / batchUpdatePerCPU

Method batchUpdatePerCPU

map.go:1440–1452  ·  view source on GitHub ↗
(keys, values any, opts *BatchOptions)

Source from the content-addressed store, hash-verified

1438}
1439
1440func (m *Map) batchUpdatePerCPU(keys, values any, opts *BatchOptions) (int, error) {
1441 count, err := sliceLen(keys)
1442 if err != nil {
1443 return 0, fmt.Errorf("keys: %w", err)
1444 }
1445
1446 valueBuf, err := marshalBatchPerCPUValue(values, count, int(m.valueSize))
1447 if err != nil {
1448 return 0, err
1449 }
1450
1451 return m.batchUpdate(count, keys, sys.UnsafeSlicePointer(valueBuf), opts)
1452}
1453
1454// BatchDelete batch deletes entries in the map by keys.
1455// "keys" must be of type slice, a pointer to a slice or buffer will not work.

Callers 1

BatchUpdateMethod · 0.95

Calls 4

batchUpdateMethod · 0.95
UnsafeSlicePointerFunction · 0.92
sliceLenFunction · 0.85
marshalBatchPerCPUValueFunction · 0.85

Tested by

no test coverage detected