From: ggaren@apple.com Date: Fri, 12 Sep 2014 23:47:56 +0000 (+0000) Subject: Fixed a goof in bmalloc Vector sizing X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=444d0fe00f3ba55fa126e95aaf8e03b4bad78859 Fixed a goof in bmalloc Vector sizing https://bugs.webkit.org/show_bug.cgi?id=136795 Reviewed by Gavin Barraclough and Sam Weinig. We want our minimum vector to be page-sized since the OS will give us a page no matter what -- but we want that many bytes, and not enough bytes to store that many elements. * bmalloc/Vector.h: Math is hard. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173589 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Source/bmalloc/ChangeLog b/Source/bmalloc/ChangeLog index 9cbed4c..5fffda4 100644 --- a/Source/bmalloc/ChangeLog +++ b/Source/bmalloc/ChangeLog @@ -1,3 +1,16 @@ +2014-09-12 Geoffrey Garen + + Fixed a goof in bmalloc Vector sizing + https://bugs.webkit.org/show_bug.cgi?id=136795 + + Reviewed by Gavin Barraclough and Sam Weinig. + + We want our minimum vector to be page-sized since the OS will give us + a page no matter what -- but we want that many bytes, and not enough + bytes to store that many elements. + + * bmalloc/Vector.h: Math is hard. + 2014-09-11 Geoffrey Garen bmalloc should segregate medium-sized objects by line like it does for small-sized objects diff --git a/Source/bmalloc/bmalloc/Vector.h b/Source/bmalloc/bmalloc/Vector.h index ebcf94d..5a0688e 100644 --- a/Source/bmalloc/bmalloc/Vector.h +++ b/Source/bmalloc/bmalloc/Vector.h @@ -66,7 +66,7 @@ public: private: static const size_t growFactor = 2; static const size_t shrinkFactor = 4; - static const size_t initialCapacity = vmPageSize; + static const size_t initialCapacity = vmPageSize / sizeof(T); void growCapacity(size_t size); void shrinkCapacity();