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

Unified Diff: runtime/vm/cpuid.cc

Issue 182943002: - Actually allocate memory. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/cpuid.cc
===================================================================
--- runtime/vm/cpuid.cc (revision 33111)
+++ runtime/vm/cpuid.cc (working copy)
@@ -50,7 +50,8 @@
CpuId::sse41_ = (info[2] & (1 << 19)) != 0;
CpuId::sse2_ = (info[3] & (1 << 26)) != 0;
- char* brand_string = reinterpret_cast<char*>(3 * 4 * sizeof(uint32_t));
+ char* brand_string =
+ reinterpret_cast<char*>(malloc(3 * 4 * sizeof(uint32_t)));
Florian Schneider 2014/02/27 10:03:22 If you use new char[] and delete[] instead of mall
Ivan Posva 2014/02/27 10:13:41 Thank you for your insight. But the whole point of
Florian Schneider 2014/02/27 10:21:29 Why use strdup then? I thought the point of return
for (uint32_t i = 0x80000002; i <= 0x80000004; i++) {
uint32_t off = (i - 0x80000002U) * 4 * sizeof(uint32_t);
GetCpuId(i, info);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698