map: move semantics for under sized per-CPU slices out of common per CPU marshaling code
lmb opened this issue · comments
We allow updating per-CPU maps with a slice that has less than PossibleCPUs items.
k := ...
v := make([]uint32, 2) // where possibleCPUs > 2
m.Update(k, v) // this will set values for CPU >= 2 to zero
The code to do this lives in the per-CPU marshalers, and makes them harder to understand. We currently invoke the same logic for batch per-CPU updates, which doesn't make a lot of sense because our API doesn't even allow passing such slices to the batch API.
As with bcca828 we should try to move this code into updatePerCPU
and other callers. This removes a special case from the batch per-CPU code paths.
I think the only remnant of this is
Lines 76 to 77 in c5e9cb3