Adjust PackedArray allocation policy
commitbdca19fd6ecdaeda53bf0e6c7a04cbda2bf9e5e0
authorBin Liu <binliu@fb.com>
Tue, 21 Oct 2014 07:44:42 +0000 (21 00:44 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Tue, 21 Oct 2014 08:00:28 +0000 (21 01:00 -0700)
tree669087be6ade229291cec898c075d99cc53951d1
parentc3f4707c4745c706b6ac34b55e8de019d0335dd3
Adjust PackedArray allocation policy

Summary: Try growing a packed array in place before reallocating memory, by taking advantage of the request-local memory manager allocation policy.
Maximize the initial capacity in emitNewArray if the capacity is within a threshold.

Reviewed By: @jasone

Differential Revision: D1601707
hphp/runtime/base/mixed-array.cpp
hphp/runtime/base/packed-array.cpp
hphp/runtime/base/packed-array.h
hphp/runtime/test/array.cpp [new file with mode: 0644]
hphp/runtime/vm/jit/hhbc-translator.cpp