| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 // induces a constraint on the order of pages in a linked lists. We say that | 485 // induces a constraint on the order of pages in a linked lists. We say that |
| 486 // pages are linked in the chunk-order if and only if every two consecutive | 486 // pages are linked in the chunk-order if and only if every two consecutive |
| 487 // pages from the same chunk are consecutive in the linked list. | 487 // pages from the same chunk are consecutive in the linked list. |
| 488 // | 488 // |
| 489 | 489 |
| 490 | 490 |
| 491 class MemoryAllocator : public AllStatic { | 491 class MemoryAllocator : public AllStatic { |
| 492 public: | 492 public: |
| 493 // Initializes its internal bookkeeping structures. | 493 // Initializes its internal bookkeeping structures. |
| 494 // Max capacity of the total space and executable memory limit. | 494 // Max capacity of the total space and executable memory limit. |
| 495 static bool Setup(int max_capacity, int capacity_executable); | 495 static bool Setup(intptr_t max_capacity, intptr_t capacity_executable); |
| 496 | 496 |
| 497 // Deletes valid chunks. | 497 // Deletes valid chunks. |
| 498 static void TearDown(); | 498 static void TearDown(); |
| 499 | 499 |
| 500 // Reserves an initial address range of virtual memory to be split between | 500 // Reserves an initial address range of virtual memory to be split between |
| 501 // the two new space semispaces, the old space, and the map space. The | 501 // the two new space semispaces, the old space, and the map space. The |
| 502 // memory is not yet committed or assigned to spaces and split into pages. | 502 // memory is not yet committed or assigned to spaces and split into pages. |
| 503 // The initial chunk is unmapped when the memory allocator is torn down. | 503 // The initial chunk is unmapped when the memory allocator is torn down. |
| 504 // This function should only be called when there is not already a reserved | 504 // This function should only be called when there is not already a reserved |
| 505 // initial chunk (initial_chunk_ should be NULL). It returns the start | 505 // initial chunk (initial_chunk_ should be NULL). It returns the start |
| (...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2269 | 2269 |
| 2270 private: | 2270 private: |
| 2271 LargeObjectChunk* current_; | 2271 LargeObjectChunk* current_; |
| 2272 HeapObjectCallback size_func_; | 2272 HeapObjectCallback size_func_; |
| 2273 }; | 2273 }; |
| 2274 | 2274 |
| 2275 | 2275 |
| 2276 } } // namespace v8::internal | 2276 } } // namespace v8::internal |
| 2277 | 2277 |
| 2278 #endif // V8_SPACES_H_ | 2278 #endif // V8_SPACES_H_ |
| OLD | NEW |