From: fschneider@chromium.org Date: Tue, 22 Nov 2011 16:02:26 +0000 (+0000) Subject: Set maximum length of FixedArray in terms of elements instead an absolute number... X-Git-Tag: upstream/4.7.83~17868 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=23e948b8a7c5b63924f1fc47f5515aa542bd4f86;p=platform%2Fupstream%2Fv8.git Set maximum length of FixedArray in terms of elements instead an absolute number of bytes. This sets the limit to 128M elements on all platforms. Before allocating a large array may cause an OutOfMemory on x64 whereas it would not on ia32. Also remove an unused constant from the FreeSpace class. BUG=103103 Review URL: http://codereview.chromium.org/8637015 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10044 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/objects.h b/src/objects.h index fc717b23e..b376bcc30 100644 --- a/src/objects.h +++ b/src/objects.h @@ -2098,7 +2098,7 @@ class FixedArray: public FixedArrayBase { // Maximal allowed size, in bytes, of a single FixedArray. // Prevents overflowing size computations, as well as extreme memory // consumption. - static const int kMaxSize = 512 * MB; + static const int kMaxSize = 128 * MB * kPointerSize; // Maximally allowed length of a FixedArray. static const int kMaxLength = (kMaxSize - kHeaderSize) / kPointerSize; @@ -3339,9 +3339,6 @@ class FreeSpace: public HeapObject { static const int kAlignedSize = OBJECT_POINTER_ALIGN(kHeaderSize); - // Maximal size of a single FreeSpace. - static const int kMaxSize = 512 * MB; - private: DISALLOW_IMPLICIT_CONSTRUCTORS(FreeSpace); };