Skip to content

Commit

Permalink
map: remove left over per-CPU marshaler changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lmb authored and nathanjsweet committed Feb 23, 2021
1 parent fcc458f commit 0ad1835
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions map.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ func (m *Map) Update(key, value interface{}, flags MapUpdateFlags) error {
return fmt.Errorf("can't marshal key: %w", err)
}

valuePtr, err := m.marshalValue(value, false)
valuePtr, err := m.marshalValue(value)
if err != nil {
return fmt.Errorf("can't marshal value: %w", err)
}
Expand Down Expand Up @@ -897,7 +897,7 @@ func (m *Map) unmarshalKey(data interface{}, buf []byte) error {
return unmarshalBytes(data, buf)
}

func (m *Map) marshalValue(data interface{}, batch bool) (internal.Pointer, error) {
func (m *Map) marshalValue(data interface{}) (internal.Pointer, error) {
if m.typ.hasPerCPUValue() {
return marshalPerCPUValue(data, int(m.valueSize))
}
Expand Down
6 changes: 1 addition & 5 deletions marshalers.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,7 @@ func marshalPerCPUValue(slice interface{}, elemLength int) (internal.Pointer, er
}

alignedElemLength := align(elemLength, 8)
alignedSliceLen := possibleCPUs
if sliceLen > alignedSliceLen {
alignedSliceLen = sliceLen
}
buf := make([]byte, alignedElemLength*alignedSliceLen)
buf := make([]byte, alignedElemLength*possibleCPUs)

for i := 0; i < sliceLen; i++ {
elem := sliceValue.Index(i).Interface()
Expand Down

0 comments on commit 0ad1835

Please sign in to comment.