C++ Logo


Advanced search

Re: Another approach to p1315r5 (secure_clear)

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sun, 16 Aug 2020 22:25:57 -0700
On Sunday, 16 August 2020 15:47:03 PDT Marcin Jaczewski via Std-Proposals
> For splitting callee-saved registers, this is an important
> observation, compiler could not see what callee does with registers,
> this means compiler needs to save them on its own side (this means all
> "safe" data need be caller-saved).

Which negates the objective of ensuring that data is never written to memory.

I think that is an unachievable objective. However, a data type that is
guaranteed by the compiler to be erased when no longer needed would be
achievable. The compiler can ensure that it clears any memory it spilled the
variable to and also any registers it used temporarily.

I'm just not sure this is a standard discussion, as opposed to a compiler
extension. Maybe just an attribute?

Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DPG Cloud Engineering

Received on 2020-08-17 00:29:25