memory_cleanse

Secure overwrite a buffer (possibly containing secret data) with zero-bytes. The write operation will not be optimized out by the compiler.

Synopsis

Declared in <support/cleanse.h>

void
memory_cleanse(
    void* ptr,
    size_t len);

Parameters

NameDescription
ptrPointer to the start of the buffer to overwrite.
lenNumber of bytes to overwrite with zeros.