Skip to content

zeroize: provide a Vec with zero-on-realloc? #179

@FauxFaux

Description

@FauxFaux

Zeroing a Vec on Drop may still leave data on the heap, as internally Vec may realloc-and-copy the data to the new size.

Is it possible to provide a Vec-like type which zeros the old data during reallocation?

Custom allocators, or hooks in the (custom) global allocator, may be future possible alternatives.

I believe that a typical realloc implementation will not copy, but it is by no means guaranteed or even likely to be true in all cases.

Spotted by @cuviper.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions