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

Side by Side Diff: runtime/vm/cpu_mips.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 | « runtime/vm/cpu_ia32.cc ('k') | runtime/vm/cpu_x64.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_MIPS) 7 #if defined(TARGET_ARCH_MIPS)
8 8
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/cpuinfo.h" 10 #include "vm/cpuinfo.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 #endif 57 #endif
58 } 58 }
59 59
60 60
61 void HostCPUFeatures::Cleanup() { 61 void HostCPUFeatures::Cleanup() {
62 DEBUG_ASSERT(initialized_); 62 DEBUG_ASSERT(initialized_);
63 #if defined(DEBUG) 63 #if defined(DEBUG)
64 initialized_ = false; 64 initialized_ = false;
65 #endif 65 #endif
66 ASSERT(hardware_ != NULL); 66 ASSERT(hardware_ != NULL);
67 delete[] hardware_; 67 free(const_cast<char*>(hardware_));
68 hardware_ = NULL; 68 hardware_ = NULL;
69 CpuInfo::Cleanup(); 69 CpuInfo::Cleanup();
70 } 70 }
71 71
72 #else 72 #else
73 73
74 void HostCPUFeatures::InitOnce() { 74 void HostCPUFeatures::InitOnce() {
75 CpuInfo::InitOnce(); 75 CpuInfo::InitOnce();
76 hardware_ = CpuInfo::GetCpuModel(); 76 hardware_ = CpuInfo::GetCpuModel();
77 #if defined(DEBUG) 77 #if defined(DEBUG)
78 initialized_ = true; 78 initialized_ = true;
79 #endif 79 #endif
80 } 80 }
81 81
82 82
83 void HostCPUFeatures::Cleanup() { 83 void HostCPUFeatures::Cleanup() {
84 DEBUG_ASSERT(initialized_); 84 DEBUG_ASSERT(initialized_);
85 #if defined(DEBUG) 85 #if defined(DEBUG)
86 initialized_ = false; 86 initialized_ = false;
87 #endif 87 #endif
88 ASSERT(hardware_ != NULL); 88 ASSERT(hardware_ != NULL);
89 delete[] hardware_; 89 free(const_cast<char*>(hardware_));
90 hardware_ = NULL; 90 hardware_ = NULL;
91 CpuInfo::Cleanup(); 91 CpuInfo::Cleanup();
92 } 92 }
93 #endif // defined(HOST_ARCH_MIPS) 93 #endif // defined(HOST_ARCH_MIPS)
94 94
95 } // namespace dart 95 } // namespace dart
96 96
97 #endif // defined TARGET_ARCH_MIPS 97 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/cpu_ia32.cc ('k') | runtime/vm/cpu_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698