OLD | NEW |
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 Loading... |
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 |
OLD | NEW |