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

Unified Diff: vm/snapshot.h

Issue 10446104: Use memmove instead of a loop to read bytes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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 | « 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: vm/snapshot.h
===================================================================
--- vm/snapshot.h (revision 8158)
+++ vm/snapshot.h (working copy)
@@ -190,6 +190,12 @@
return *current_++;
}
+ void ReadBytes(uint8_t* addr, intptr_t len) {
+ ASSERT((current_ + len) < end_);
+ memmove(addr, current_, len);
+ current_ += len;
+ }
+
private:
const uint8_t* buffer_;
const uint8_t* current_;
@@ -320,6 +326,10 @@
return value;
}
+ void ReadBytes(uint8_t* addr, intptr_t len) {
+ stream_.ReadBytes(addr, len);
+ }
+
RawSmi* ReadAsSmi();
intptr_t ReadSmiValue();
« no previous file with comments | « vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698