Index: src/heap.cc |
=================================================================== |
--- src/heap.cc (revision 8361) |
+++ src/heap.cc (working copy) |
@@ -153,6 +153,16 @@ |
max_semispace_size_ = reserved_semispace_size_ = V8_MAX_SEMISPACE_SIZE; |
#endif |
+ intptr_t max_virtual = OS::MaxVirtualMemory(); |
+ |
+ if (max_virtual > 0) { |
+ intptr_t eighth = max_virtual >> 3; |
Mads Ager (chromium)
2011/06/22 09:42:01
With this name I'm not sure this makes it more rea
Erik Corry
2011/06/22 09:56:36
Done.
|
+ if (code_range_size_ > 0) { |
+ // Reserve no more than 1/8 of the memory for the code range. |
+ code_range_size_ = Min(code_range_size_, eighth); |
+ } |
+ } |
+ |
memset(roots_, 0, sizeof(roots_[0]) * kRootListLength); |
global_contexts_list_ = NULL; |
mark_compact_collector_.heap_ = this; |