-
Notifications
You must be signed in to change notification settings - Fork 708
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sysenc: special case unmarshaling into []byte
The library has somewhat complicated semantics when unmarshaling map keys and values. It turns out that the following was supported (but not documented) until the zero-allocation marshaling work broke it: var s []byte m.Lookup(key, &s) The important thing is that the slice here is empty. The current code treats this as "the key should be zero length" while originally we'd assign the temporary buffer used by the syscall to s as a way to reduce allocations. In hindsight this wasn't a great idea, but it is what it is. Reintroduce the byte slice special case. Fixes #1175 Signed-off-by: Lorenz Bauer <[email protected]>
- Loading branch information
Showing
3 changed files
with
12 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters