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

Unified Diff: runtime/vm/snapshot.h

Issue 604553003: Don't use the size-zero array hack to access variable data in Snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.h
diff --git a/runtime/vm/snapshot.h b/runtime/vm/snapshot.h
index 82e689f17ada97e9e9267bb2af51af8b39e004d1..300babba53348264966d49bcfb4fcfe9ac8c511a 100644
--- a/runtime/vm/snapshot.h
+++ b/runtime/vm/snapshot.h
@@ -145,7 +145,6 @@ class Snapshot {
static const Snapshot* SetupFromBuffer(const void* raw_memory);
// Getters.
- const uint8_t* content() const { return content_; }
intptr_t length() const {
return static_cast<intptr_t>(ReadUnaligned(&unaligned_length_));
}
@@ -172,8 +171,12 @@ class Snapshot {
// The following fields are potentially unaligned.
int64_t unaligned_length_; // Stream length.
int64_t unaligned_kind_; // Kind of snapshot.
- uint8_t content_[]; // Stream content.
+ public:
+ // Variable length data follows here.
+ const uint8_t* content() const { OPEN_ARRAY_START(uint8_t, uint8_t); }
siva 2014/09/24 22:02:53 Why not move this block to the top above the 'priv
rmacnak 2014/09/24 22:38:08 The intention was for content() to appear in the p
+
+ private:
DISALLOW_COPY_AND_ASSIGN(Snapshot);
};
« no previous file with comments | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698