Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysenc: special case unmarshaling into []byte #1180

Merged
merged 2 commits into from
Oct 20, 2023

Commits on Oct 20, 2023

  1. map: use t.Cleanup in createArray

    Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
    lmb committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    b79948e View commit details
    Browse the repository at this point in the history
  2. 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 cilium#1175
    
    Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
    lmb committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    eac52a4 View commit details
    Browse the repository at this point in the history