| Index: runtime/vm/cpuinfo_linux.cc
|
| diff --git a/runtime/vm/cpuinfo_linux.cc b/runtime/vm/cpuinfo_linux.cc
|
| index e58bac1fe6a0d5f2f6bb953a6904038386854b8b..8d76233194a59cb0ef9416dcb362f79ffb886af6 100644
|
| --- a/runtime/vm/cpuinfo_linux.cc
|
| +++ b/runtime/vm/cpuinfo_linux.cc
|
| @@ -67,7 +67,10 @@ void CpuInfo::Cleanup() {
|
|
|
| bool CpuInfo::FieldContains(CpuInfoIndices idx, const char* search_string) {
|
| if (method_ == kCpuInfoCpuId) {
|
| - return strstr(CpuId::field(idx), search_string);
|
| + const char* field = CpuId::field(idx);
|
| + bool contains = (strstr(field, search_string) != NULL);
|
| + free(const_cast<char*>(field));
|
| + return contains;
|
| } else {
|
| ASSERT(method_ == kCpuInfoSystem);
|
| return ProcCpuInfo::FieldContains(FieldName(idx), search_string);
|
| @@ -75,23 +78,6 @@ bool CpuInfo::FieldContains(CpuInfoIndices idx, const char* search_string) {
|
| }
|
|
|
|
|
| -bool CpuInfo::FieldContainsByString(const char* field,
|
| - const char* search_string) {
|
| - if (method_ == kCpuInfoCpuId) {
|
| - for (int i = 0; i < kCpuInfoMax; i++) {
|
| - if (strcmp(field, fields_[i]) == 0) {
|
| - return FieldContains(static_cast<CpuInfoIndices>(i), search_string);
|
| - }
|
| - }
|
| - UNIMPLEMENTED();
|
| - return false;
|
| - } else {
|
| - ASSERT(method_ == kCpuInfoSystem);
|
| - return ProcCpuInfo::FieldContains(field, search_string);
|
| - }
|
| -}
|
| -
|
| -
|
| const char* CpuInfo::ExtractField(CpuInfoIndices idx) {
|
| if (method_ == kCpuInfoCpuId) {
|
| return CpuId::field(idx);
|
| @@ -102,22 +88,6 @@ const char* CpuInfo::ExtractField(CpuInfoIndices idx) {
|
| }
|
|
|
|
|
| -const char* CpuInfo::ExtractFieldByString(const char* field) {
|
| - if (method_ == kCpuInfoCpuId) {
|
| - for (int i = 0; i < kCpuInfoMax; i++) {
|
| - if (strcmp(field, fields_[i]) == 0) {
|
| - return ExtractField(static_cast<CpuInfoIndices>(i));
|
| - }
|
| - }
|
| - UNIMPLEMENTED();
|
| - return NULL;
|
| - } else {
|
| - ASSERT(method_ == kCpuInfoSystem);
|
| - return ProcCpuInfo::ExtractField(field);
|
| - }
|
| -}
|
| -
|
| -
|
| bool CpuInfo::HasField(const char* field) {
|
| if (method_ == kCpuInfoCpuId) {
|
| return (strcmp(field, fields_[kCpuInfoProcessor]) == 0) ||
|
|
|