Index: src/serialize.cc |
=================================================================== |
--- src/serialize.cc (revision 1142) |
+++ src/serialize.cc (working copy) |
@@ -686,15 +686,15 @@ |
SnapshotWriter() { |
len_ = 0; |
max_ = 8 << 10; // 8K initial size |
- str_ = NewArray<char>(max_); |
+ str_ = NewArray<byte>(max_); |
} |
~SnapshotWriter() { |
DeleteArray(str_); |
} |
- void GetString(char** str, int* len) { |
- *str = NewArray<char>(len_); |
+ void GetBytes(byte** str, int* len) { |
+ *str = NewArray<byte>(len_); |
memcpy(*str, str_, len_); |
*len = len_; |
} |
@@ -742,7 +742,7 @@ |
Address position() { return reinterpret_cast<Address>(&str_[len_]); } |
private: |
- char* str_; // the snapshot |
+ byte* str_; // the snapshot |
int len_; // the current length of str_ |
int max_; // the allocated size of str_ |
}; |
@@ -752,14 +752,14 @@ |
CHECK(0 <= pos && pos <= len_); |
while (len_ + bytes >= max_) { |
max_ *= 2; |
- char* old = str_; |
- str_ = NewArray<char>(max_); |
+ byte* old = str_; |
+ str_ = NewArray<byte>(max_); |
memcpy(str_, old, len_); |
DeleteArray(old); |
} |
if (pos < len_) { |
- char* old = str_; |
- str_ = NewArray<char>(max_); |
+ byte* old = str_; |
+ str_ = NewArray<byte>(max_); |
memcpy(str_, old, pos); |
memcpy(str_ + pos + bytes, old + pos, len_ - pos); |
DeleteArray(old); |
@@ -929,8 +929,8 @@ |
} |
-void Serializer::Finalize(char** str, int* len) { |
- writer_->GetString(str, len); |
+void Serializer::Finalize(byte** str, int* len) { |
+ writer_->GetBytes(str, len); |
} |
@@ -1180,7 +1180,7 @@ |
static const int kInitArraySize = 32; |
-Deserializer::Deserializer(const char* str, int len) |
+Deserializer::Deserializer(const byte* str, int len) |
: reader_(str, len), |
map_pages_(kInitArraySize), |
old_pointer_pages_(kInitArraySize), |