Allocate HphpArrays in a flat mode instead of using m_inline_data
Gets HphpArrays into a flat mode using MM().objMalloc() instead of SmartAllocator. Various optimizations were needed to the Make functions to get this to work out ok. Growth still creates a non-flat HphpArray (leaving a PromotedPayload behind so we know how big the original allocation was). Reviewed By: @edwinsmith Differential Revision: D969431
Esse commit está contido em:
@@ -30,13 +30,15 @@ ArrayInit::ArrayInit(ssize_t n) {
|
||||
// Force compilation of PolicyArray
|
||||
m_data = NEW(PolicyArray)(n);
|
||||
} else {
|
||||
m_data = ArrayData::Make(n);
|
||||
m_data = HphpArray::MakeReserve(n);
|
||||
m_data->setRefCount(0);
|
||||
}
|
||||
}
|
||||
|
||||
HOT_FUNC
|
||||
ArrayInit::ArrayInit(ssize_t n, MapInit)
|
||||
: m_data(ArrayData::Make(n)) {
|
||||
: m_data(HphpArray::MakeReserve(n)) {
|
||||
m_data->setRefCount(0);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário