OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 21 matching lines...) Expand all Loading... |
32 #include "globals.h" | 32 #include "globals.h" |
33 | 33 |
34 namespace v8 { | 34 namespace v8 { |
35 namespace internal { | 35 namespace internal { |
36 | 36 |
37 // ----------------------------------------------------------------------------- | 37 // ----------------------------------------------------------------------------- |
38 // VirtualMemory | 38 // VirtualMemory |
39 // | 39 // |
40 // This class represents and controls an area of reserved memory. | 40 // This class represents and controls an area of reserved memory. |
41 // Control of the reserved memory can be assigned to another VirtualMemory | 41 // Control of the reserved memory can be assigned to another VirtualMemory |
42 // object by assignment or contructing. This removes the reserved memory from | 42 // object by assignment or copy-constructing. This removes the reserved memory |
43 // the original object. | 43 // from the original object. |
44 class VirtualMemory V8_FINAL { | 44 class VirtualMemory V8_FINAL { |
45 public: | 45 public: |
46 // The executability of a memory region. | 46 // The executability of a memory region. |
47 enum Executability { NOT_EXECUTABLE, EXECUTABLE }; | 47 enum Executability { NOT_EXECUTABLE, EXECUTABLE }; |
48 | 48 |
49 // Empty VirtualMemory object, controlling no reserved memory. | 49 // Empty VirtualMemory object, controlling no reserved memory. |
50 VirtualMemory() : address_(NULL), size_(0) {} | 50 VirtualMemory() : address_(NULL), size_(0) {} |
51 | 51 |
52 // Reserves virtual memory with size. | 52 // Reserves virtual memory with size. |
53 explicit VirtualMemory(size_t size) : size_(0) { | 53 explicit VirtualMemory(size_t size) : size_(0) { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 } | 202 } |
203 | 203 |
204 private: | 204 private: |
205 void* address_; // Start address of the virtual memory. | 205 void* address_; // Start address of the virtual memory. |
206 size_t size_; // Size of the virtual memory. | 206 size_t size_; // Size of the virtual memory. |
207 }; | 207 }; |
208 | 208 |
209 } } // namespace v8::internal | 209 } } // namespace v8::internal |
210 | 210 |
211 #endif // V8_PLATFORM_VIRTUAL_MEMORY_H_ | 211 #endif // V8_PLATFORM_VIRTUAL_MEMORY_H_ |
OLD | NEW |