void zend_accel_move_user_functions(HashTable *src, HashTable *dst) { Bucket *p; dtor_func_t orig_dtor = src->pDestructor; src->pDestructor = NULL; zend_hash_extend(dst, dst->nNumUsed + src->nNumUsed, 0); ZEND_HASH_REVERSE_FOREACH_BUCKET(src, p) { zend_function *function = Z_PTR(p->val); if (EXPECTED(function->type == ZEND_USER_FUNCTION)) { _zend_hash_append_ptr(dst, p->key, function); zend_hash_del_bucket(src, p); } else { break; } } ZEND_HASH_FOREACH_END();
void zend_accel_move_user_functions(HashTable *src, zend_script *script) { Bucket *p; HashTable *dst = &script->function_table; zend_string *filename = script->main_op_array.filename; dtor_func_t orig_dtor = src->pDestructor; src->pDestructor = NULL; zend_hash_extend(dst, dst->nNumUsed + src->nNumUsed, 0); ZEND_HASH_REVERSE_FOREACH_BUCKET(src, p) { zend_function *function = Z_PTR(p->val); if (EXPECTED(function->type == ZEND_USER_FUNCTION) && EXPECTED(function->op_array.filename == filename)) { _zend_hash_append_ptr(dst, p->key, function); zend_hash_del_bucket(src, p); } else { break; } } ZEND_HASH_FOREACH_END();