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

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

Issue 182883002: - Sort out confusion between malloc/free and new/delete. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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 | « no previous file | runtime/vm/cpu_ia32.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/globals.h" 5 #include "vm/globals.h"
6 6
7 #if defined(TARGET_ARCH_ARM) 7 #if defined(TARGET_ARCH_ARM)
8 8
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/cpuinfo.h" 10 #include "vm/cpuinfo.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 #endif 82 #endif
83 } 83 }
84 84
85 85
86 void HostCPUFeatures::Cleanup() { 86 void HostCPUFeatures::Cleanup() {
87 DEBUG_ASSERT(initialized_); 87 DEBUG_ASSERT(initialized_);
88 #if defined(DEBUG) 88 #if defined(DEBUG)
89 initialized_ = false; 89 initialized_ = false;
90 #endif 90 #endif
91 ASSERT(hardware_ != NULL); 91 ASSERT(hardware_ != NULL);
92 delete[] hardware_; 92 free(const_cast<char*>(hardware_));
93 hardware_ = NULL; 93 hardware_ = NULL;
94 CpuInfo::Cleanup(); 94 CpuInfo::Cleanup();
95 } 95 }
96 96
97 #else 97 #else
98 98
99 void HostCPUFeatures::InitOnce() { 99 void HostCPUFeatures::InitOnce() {
100 CpuInfo::InitOnce(); 100 CpuInfo::InitOnce();
101 hardware_ = CpuInfo::GetCpuModel(); 101 hardware_ = CpuInfo::GetCpuModel();
102 integer_division_supported_ = true; 102 integer_division_supported_ = true;
103 neon_supported_ = true; 103 neon_supported_ = true;
104 #if defined(DEBUG) 104 #if defined(DEBUG)
105 initialized_ = true; 105 initialized_ = true;
106 #endif 106 #endif
107 } 107 }
108 108
109 109
110 void HostCPUFeatures::Cleanup() { 110 void HostCPUFeatures::Cleanup() {
111 DEBUG_ASSERT(initialized_); 111 DEBUG_ASSERT(initialized_);
112 #if defined(DEBUG) 112 #if defined(DEBUG)
113 initialized_ = false; 113 initialized_ = false;
114 #endif 114 #endif
115 ASSERT(hardware_ != NULL); 115 ASSERT(hardware_ != NULL);
116 delete[] hardware_; 116 free(const_cast<char*>(hardware_));
117 hardware_ = NULL; 117 hardware_ = NULL;
118 CpuInfo::Cleanup(); 118 CpuInfo::Cleanup();
119 } 119 }
120 #endif // defined(HOST_ARCH_ARM) 120 #endif // defined(HOST_ARCH_ARM)
121 121
122 } // namespace dart 122 } // namespace dart
123 123
124 #endif // defined TARGET_ARCH_ARM 124 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/cpu_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698