|
-
February 2nd, 2012, 09:52 PM
#3
Re: Secure Memset
Surely there must be something more elegant than using the volatile keyword and a manually written loop. Honestly, the aforementioned links don't do a very good job of explaining why the volatile keyword prevents optimization. Moreover, how can the compiler possibly know what is going to happen at run-time? If I try to reset pointers to zero in a destructor after destroying an object, will that be optimized away? That makes no sense to me, but the compiler could determine that operation is pointless since the object is being destroyed just as easily as it could assume that the memset isn't really necessary. Unfortunately, I have not seen a realistic example that proves the theory one way or the other.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|