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

Side by Side Diff: runtime/vm/object.cc

Issue 16271010: Use 'new' in all the snapshot reallocation functions instead of realloc. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/megamorphic_cache_table.cc ('k') | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 5436 matching lines...) Expand 10 before | Expand all | Expand 10 after
5447 return -1; 5447 return -1;
5448 } 5448 }
5449 5449
5450 void WriteIndex(intptr_t value) { 5450 void WriteIndex(intptr_t value) {
5451 stream_.WriteUnsigned(value + Token::kNumTokens); 5451 stream_.WriteUnsigned(value + Token::kNumTokens);
5452 } 5452 }
5453 5453
5454 static uint8_t* Reallocate(uint8_t* ptr, 5454 static uint8_t* Reallocate(uint8_t* ptr,
5455 intptr_t old_size, 5455 intptr_t old_size,
5456 intptr_t new_size) { 5456 intptr_t new_size) {
5457 void* new_ptr = ::realloc(reinterpret_cast<void*>(ptr), new_size); 5457 return Utils::Realloc(ptr, old_size, new_size);
5458 return reinterpret_cast<uint8_t*>(new_ptr);
5459 } 5458 }
5460 5459
5461 static const int kInitialTokenCount = 32; 5460 static const int kInitialTokenCount = 32;
5462 static const intptr_t kTableSize = 128; 5461 static const intptr_t kTableSize = 128;
5463 5462
5464 uint8_t* buffer_; 5463 uint8_t* buffer_;
5465 WriteStream stream_; 5464 WriteStream stream_;
5466 GrowableArray<intptr_t> ident_table_[kTableSize]; 5465 GrowableArray<intptr_t> ident_table_[kTableSize];
5467 GrowableArray<intptr_t> literal_table_[kTableSize]; 5466 GrowableArray<intptr_t> literal_table_[kTableSize];
5468 const GrowableObjectArray& token_objects_; 5467 const GrowableObjectArray& token_objects_;
(...skipping 7860 matching lines...) Expand 10 before | Expand all | Expand 10 after
13329 space); 13328 space);
13330 return reinterpret_cast<RawWeakProperty*>(raw); 13329 return reinterpret_cast<RawWeakProperty*>(raw);
13331 } 13330 }
13332 13331
13333 13332
13334 const char* WeakProperty::ToCString() const { 13333 const char* WeakProperty::ToCString() const {
13335 return "_WeakProperty"; 13334 return "_WeakProperty";
13336 } 13335 }
13337 13336
13338 } // namespace dart 13337 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/megamorphic_cache_table.cc ('k') | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698