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

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

Issue 10836061: Change the zone allocation api. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/raw_object_snapshot.cc ('k') | runtime/vm/stack_frame_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 "include/dart_debugger_api.h" 5 #include "include/dart_debugger_api.h"
6 #include "platform/assert.h" 6 #include "platform/assert.h"
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/dart_api_message.h" 10 #include "vm/dart_api_message.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 static uint8_t* malloc_allocator( 43 static uint8_t* malloc_allocator(
44 uint8_t* ptr, intptr_t old_size, intptr_t new_size) { 44 uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
45 return reinterpret_cast<uint8_t*>(realloc(ptr, new_size)); 45 return reinterpret_cast<uint8_t*>(realloc(ptr, new_size));
46 } 46 }
47 47
48 48
49 static uint8_t* zone_allocator( 49 static uint8_t* zone_allocator(
50 uint8_t* ptr, intptr_t old_size, intptr_t new_size) { 50 uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
51 Zone* zone = Isolate::Current()->current_zone(); 51 Zone* zone = Isolate::Current()->current_zone();
52 return reinterpret_cast<uint8_t*>( 52 return zone->Realloc<uint8_t>(ptr, old_size, new_size);
53 zone->Reallocate(reinterpret_cast<uword>(ptr), old_size, new_size));
54 } 53 }
55 54
56 55
57 static Dart_CObject* DecodeMessage(uint8_t* message, 56 static Dart_CObject* DecodeMessage(uint8_t* message,
58 intptr_t length, 57 intptr_t length,
59 ReAlloc allocator) { 58 ReAlloc allocator) {
60 ApiMessageReader message_reader(message, length, allocator); 59 ApiMessageReader message_reader(message, length, allocator);
61 return message_reader.ReadMessage(); 60 return message_reader.ReadMessage();
62 } 61 }
63 62
(...skipping 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 EXPECT(Dart_ErrorHasException(result)); 1562 EXPECT(Dart_ErrorHasException(result));
1564 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", 1563 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n",
1565 Dart_GetError(result)); 1564 Dart_GetError(result));
1566 1565
1567 Dart_ExitScope(); 1566 Dart_ExitScope();
1568 } 1567 }
1569 1568
1570 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). 1569 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
1571 1570
1572 } // namespace dart 1571 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | runtime/vm/stack_frame_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698