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

Side by Side Diff: runtime/vm/virtual_memory_linux.cc

Issue 12282051: Prepare for removal of source_filter.gypi: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/virtual_memory_android.cc ('k') | runtime/vm/virtual_memory_macos.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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h"
6 #if defined(TARGET_OS_LINUX)
7
5 #include "vm/virtual_memory.h" 8 #include "vm/virtual_memory.h"
6 9
7 #include <sys/mman.h> 10 #include <sys/mman.h> // NOLINT
8 #include <sys/unistd.h> 11 #include <sys/unistd.h> // NOLINT
9 #include <unistd.h> 12 #include <unistd.h> // NOLINT
10 13
11 #include "platform/assert.h" 14 #include "platform/assert.h"
12 #include "platform/utils.h" 15 #include "platform/utils.h"
13 16
14 namespace dart { 17 namespace dart {
15 18
16 // standard MAP_FAILED causes "error: use of old-style cast" as it 19 // standard MAP_FAILED causes "error: use of old-style cast" as it
17 // defines MAP_FAILED as ((void *) -1) 20 // defines MAP_FAILED as ((void *) -1)
18 #undef MAP_FAILED 21 #undef MAP_FAILED
19 #define MAP_FAILED reinterpret_cast<void*>(-1) 22 #define MAP_FAILED reinterpret_cast<void*>(-1)
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 prot = PROT_READ | PROT_EXEC; 92 prot = PROT_READ | PROT_EXEC;
90 break; 93 break;
91 case kReadWriteExecute: 94 case kReadWriteExecute:
92 prot = PROT_READ | PROT_WRITE | PROT_EXEC; 95 prot = PROT_READ | PROT_WRITE | PROT_EXEC;
93 break; 96 break;
94 } 97 }
95 return (mprotect(address(), size(), prot) == 0); 98 return (mprotect(address(), size(), prot) == 0);
96 } 99 }
97 100
98 } // namespace dart 101 } // namespace dart
102
103 #endif // defined(TARGET_OS_LINUX)
OLDNEW
« no previous file with comments | « runtime/vm/virtual_memory_android.cc ('k') | runtime/vm/virtual_memory_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698