Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(833)

Unified Diff: runtime/vm/snapshot.cc

Issue 157053007: - Zap the allocated object when allocating uninitialized memory in debug. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.cc
===================================================================
--- runtime/vm/snapshot.cc (revision 32504)
+++ runtime/vm/snapshot.cc (working copy)
@@ -723,6 +723,15 @@
ErrorHandle()->set_exception(exception);
Isolate::Current()->long_jump_base()->Jump(1, *ErrorHandle());
}
+#if defined(DEBUG)
+ // Zap the uninitialized memory area.
+ uword current = address;
+ uword end = address + size;
regis 2014/02/10 17:49:05 You could end at address + size - kWordSize, since
+ while (current < end) {
+ *reinterpret_cast<intptr_t*>(current) = kZapUninitializedWord;
+ current += kWordSize;
+ }
+#endif // defined(DBEUG)
// Make sure to initialize the last word, as this can be left untouched in
// case the object deserialized has an alignment tail.
*reinterpret_cast<RawObject**>(address + size - kWordSize) = Object::null();
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698