• Brenden Blanco's avatar
    Use late-binding to finalize snprintf/sscanf · 22eae8c6
    Brenden Blanco authored
    Not all users require the snprintf/sscanf helpers, and in some types the
    finalization can take a long time. Defer the finalization until the
    first use. Wrap the invocation with a bound function such that the
    BPFTable and other users don't need to keep an explicit BPFModule
    reference. Use-after-free will be avoided by resetting the function to
    an error-returning stub when/if the BPFModule is freed.
    Signed-off-by: default avatarBrenden Blanco <bblanco@gmail.com>
    22eae8c6
bpf_module.h 4.47 KB