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

Side by Side Diff: src/base/platform/platform.h

Issue 1111733002: [clang] Use -Wshorten-64-to-32 to enable warnings about 64bit to 32bit truncations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Win warnings. Created 5 years, 7 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
« no previous file with comments | « samples/shell.cc ('k') | src/base/platform/platform-aix.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This module contains the platform-specific code. This make the rest of the 5 // This module contains the platform-specific code. This make the rest of the
6 // code less dependent on operating system, compilers and runtime libraries. 6 // code less dependent on operating system, compilers and runtime libraries.
7 // This module does specifically not deal with differences between different 7 // This module does specifically not deal with differences between different
8 // processor architecture. 8 // processor architecture.
9 // The platform classes have the same definition for all platforms. The 9 // The platform classes have the same definition for all platforms. The
10 // implementation for a particular platform is put in platform_<os>.cc. 10 // implementation for a particular platform is put in platform_<os>.cc.
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 static const int kStackWalkError = -1; 203 static const int kStackWalkError = -1;
204 static const int kStackWalkMaxNameLen = 256; 204 static const int kStackWalkMaxNameLen = 256;
205 static const int kStackWalkMaxTextLen = 256; 205 static const int kStackWalkMaxTextLen = 256;
206 struct StackFrame { 206 struct StackFrame {
207 void* address; 207 void* address;
208 char text[kStackWalkMaxTextLen]; 208 char text[kStackWalkMaxTextLen];
209 }; 209 };
210 210
211 class MemoryMappedFile { 211 class MemoryMappedFile {
212 public: 212 public:
213 virtual ~MemoryMappedFile() {}
214 virtual void* memory() const = 0;
215 virtual size_t size() const = 0;
216
213 static MemoryMappedFile* open(const char* name); 217 static MemoryMappedFile* open(const char* name);
214 static MemoryMappedFile* create(const char* name, int size, void* initial); 218 static MemoryMappedFile* create(const char* name, size_t size,
215 virtual ~MemoryMappedFile() { } 219 void* initial);
216 virtual void* memory() = 0;
217 virtual int size() = 0;
218 }; 220 };
219 221
220 // Safe formatting print. Ensures that str is always null-terminated. 222 // Safe formatting print. Ensures that str is always null-terminated.
221 // Returns the number of chars written, or -1 if output was truncated. 223 // Returns the number of chars written, or -1 if output was truncated.
222 static int SNPrintF(char* str, int length, const char* format, ...); 224 static int SNPrintF(char* str, int length, const char* format, ...);
223 static int VSNPrintF(char* str, 225 static int VSNPrintF(char* str,
224 int length, 226 int length,
225 const char* format, 227 const char* format,
226 va_list args); 228 va_list args);
227 229
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 char name_[kMaxThreadNameLength]; 470 char name_[kMaxThreadNameLength];
469 int stack_size_; 471 int stack_size_;
470 Semaphore* start_semaphore_; 472 Semaphore* start_semaphore_;
471 473
472 DISALLOW_COPY_AND_ASSIGN(Thread); 474 DISALLOW_COPY_AND_ASSIGN(Thread);
473 }; 475 };
474 476
475 } } // namespace v8::base 477 } } // namespace v8::base
476 478
477 #endif // V8_BASE_PLATFORM_PLATFORM_H_ 479 #endif // V8_BASE_PLATFORM_PLATFORM_H_
OLDNEW
« no previous file with comments | « samples/shell.cc ('k') | src/base/platform/platform-aix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698