Chromium Code Reviews| Index: src/platform-win32.cc |
| diff --git a/src/platform-win32.cc b/src/platform-win32.cc |
| index c50424e57a44a83733c2078b70691a5a50689304..a669550da1b36153858b7347bc2175acf94987c9 100644 |
| --- a/src/platform-win32.cc |
| +++ b/src/platform-win32.cc |
| @@ -207,6 +207,11 @@ int strncpy_s(char* strDest, size_t numberOfElements, |
| return 0; |
| } |
|
Erik Corry
2010/12/01 22:10:18
Extra blank line needed here (2 blank lines betwee
|
| +inline void MemoryBarrier() { |
| + long barrier = 0; |
| + __asm__ __volatile__("xchgl %%eax,%0 ":"=r" (barrier)); |
| +} |
| + |
| #endif // __MINGW32__ |
| // Generate a pseudo-random number in the range 0-2^31-1. Usually |
| @@ -858,13 +863,13 @@ void* OS::Allocate(const size_t requested, |
| // VirtualAlloc rounds allocated size to page size automatically. |
| size_t msize = RoundUp(requested, static_cast<int>(GetPageSize())); |
| - intptr_t address = NULL; |
| + intptr_t address = (intptr_t)NULL; |
|
Erik Corry
2010/12/01 22:10:18
We don't allow C-style casts in V8. See the Googl
|
| // Windows XP SP2 allows Data Excution Prevention (DEP). |
| int prot = is_executable ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE; |
| // For exectutable pages try and randomize the allocation address |
| - if (prot == PAGE_EXECUTE_READWRITE && msize >= Page::kPageSize) { |
| + if (prot == PAGE_EXECUTE_READWRITE && msize >= (size_t)Page::kPageSize) { |
|
Erik Corry
2010/12/01 22:10:18
C-style cast
|
| address = (V8::RandomPrivate() << kPageSizeBits) |
| | kAllocationRandomAddressMin; |
| address &= kAllocationRandomAddressMax; |
| @@ -874,7 +879,7 @@ void* OS::Allocate(const size_t requested, |
| msize, |
| MEM_COMMIT | MEM_RESERVE, |
| prot); |
| - if (mbase == NULL && address != NULL) |
| + if (mbase == NULL && address != (intptr_t)NULL) |
|
Erik Corry
2010/12/01 22:10:18
C-style cast
|
| mbase = VirtualAlloc(NULL, msize, MEM_COMMIT | MEM_RESERVE, prot); |
| if (mbase == NULL) { |
| @@ -1347,6 +1352,7 @@ int OS::StackWalk(Vector<OS::StackFrame> frames) { |
| #else // __MINGW32__ |
| void OS::LogSharedLibraryAddresses() { } |
| +void OS::SignalCodeMovingGC() { } |
| int OS::StackWalk(Vector<OS::StackFrame> frames) { return 0; } |
| #endif // __MINGW32__ |