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

internal: use runtime.Pinner in PtrGuard #935

Merged
merged 1 commit into from
Oct 23, 2023
Merged

Commits on Oct 19, 2023

  1. internal: use runtime.Pinner in PtrGuard

    Since Go 1.21 there is a runtime.Pinner API that allows to safely
    pass structures with embedded Go pointers to C code.  In earlier Go
    version we know that the garbage collector is non-moving, so it is
    safe to pass Go pointers to C as well. This change adds two
    implementations of PtrGuard, one for pre 1.21 that is basically a
    no-op, and one for 1.21+ that uses runtime.Pinner.
    
    Signed-off-by: Sven Anderson <sven@redhat.com>
    ansiwen committed Oct 19, 2023
    Configuration menu
    Copy the full SHA
    9301a3e View commit details
    Browse the repository at this point in the history