Skip to content

runtime/secret, runtime: allocations are zeroed twice #76788

@DanielMorsing

Description

@DanielMorsing

Currently, we don't make any attempt to detect whether an allocation is eagerly zeroed during GC sweeping by the runtime/secret support code. When that allocation is reused later, it will get zeroed again, even though we could infer that it already contains zeros.

I don't think the overhead of storing individual objects zeroed state is worth it and the double zeroing shouldn't be too expensive because secret allocations are meant to be fairly small. Maybe we could implement a separate class of spans for secret allocations, but that's a lot of complexity for not a lot of gain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ImplementationIssues describing a semantics-preserving change to the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions