php

zend_update_property hashtable nTableSize

php版本:7.0.9
/* ~~~ proto ProtocolBuffers_DescriptorBuilder ProtocolBuffers_DescriptorBuilder::__construct()
*/
PHP_METHOD(berg_buffers, __construct)
{
zval *instance = getThis();
zval fields;
array_init(&fields);
zend_update_property(berg_buffers_class_entry,getThis(),ZEND_STRL("fields"),&fields);
zval_ptr_dtor(&fields);
zval *fields1;
zend_string *fields_name = zend_string_init(ZEND_STRL("fields"),0);
fields1=zend_hash_find(Z_OBJPROP_P(instance), fields_name);

//(gdb) p fields1->u2
//$1 = {var_flags = 4294967295, next = 4294967295, cache_slot = 4294967295, lineno = 4294967295, num_args = 4294967295, fe_pos = 4294967295, fe_iter_idx = 4294967295}
//(gdb) p fields1->value->arr->nNumUsed
//$4 = 1
//(gdb) p fields1->value->arr->nTableSize
//$5 = 4294956704,应该是:8
//(gdb) p fields1->value->arr->nNumOfElements
//$6 = 0
}
里面的nTableSize值理论上应该是:8,找不到原因,请帮忙看下!!
已邀请:

张三俗

赞同来自:

由于nTableSize值过大,在插入或者更新hashtable的时候导致PHP出现 Out Of Memory

要回复问题请先登录注册