OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 368 |
369 UpdateAllocatedSpaceLimits(base, static_cast<int>(size)); | 369 UpdateAllocatedSpaceLimits(base, static_cast<int>(size)); |
370 return true; | 370 return true; |
371 } | 371 } |
372 | 372 |
373 | 373 |
374 bool VirtualMemory::Guard(void* address) { | 374 bool VirtualMemory::Guard(void* address) { |
375 if (NULL == VirtualAlloc(address, | 375 if (NULL == VirtualAlloc(address, |
376 OS::CommitPageSize(), | 376 OS::CommitPageSize(), |
377 MEM_COMMIT, | 377 MEM_COMMIT, |
378 PAGE_READONLY | PAGE_GUARD)) { | 378 PAGE_NOACCESS)) { |
379 return false; | 379 return false; |
380 } | 380 } |
381 return true; | 381 return true; |
382 } | 382 } |
383 | 383 |
384 | 384 |
385 bool VirtualMemory::UncommitRegion(void* base, size_t size) { | 385 bool VirtualMemory::UncommitRegion(void* base, size_t size) { |
386 return VirtualFree(base, size, MEM_DECOMMIT) != 0; | 386 return VirtualFree(base, size, MEM_DECOMMIT) != 0; |
387 } | 387 } |
388 | 388 |
(...skipping 20 matching lines...) Expand all Loading... |
409 limit_mutex = new Mutex(); | 409 limit_mutex = new Mutex(); |
410 } | 410 } |
411 | 411 |
412 | 412 |
413 void OS::TearDown() { | 413 void OS::TearDown() { |
414 delete limit_mutex; | 414 delete limit_mutex; |
415 } | 415 } |
416 | 416 |
417 | 417 |
418 } } // namespace v8::internal | 418 } } // namespace v8::internal |
OLD | NEW |