Lines Matching refs:callback_data

923 	zend_ffi_callback_data *callback_data = Z_PTR_P(zv);  in zend_ffi_callback_hash_dtor()  local
925 ffi_closure_free(callback_data->callback); in zend_ffi_callback_hash_dtor()
926 if (callback_data->fcc.function_handler->common.fn_flags & ZEND_ACC_CLOSURE) { in zend_ffi_callback_hash_dtor()
927 OBJ_RELEASE(ZEND_CLOSURE_OBJECT(callback_data->fcc.function_handler)); in zend_ffi_callback_hash_dtor()
929 for (int i = 0; i < callback_data->arg_count; ++i) { in zend_ffi_callback_hash_dtor()
930 if (callback_data->arg_types[i]->type == FFI_TYPE_STRUCT) { in zend_ffi_callback_hash_dtor()
931 efree(callback_data->arg_types[i]); in zend_ffi_callback_hash_dtor()
934 if (callback_data->ret_type->type == FFI_TYPE_STRUCT) { in zend_ffi_callback_hash_dtor()
935 efree(callback_data->ret_type); in zend_ffi_callback_hash_dtor()
937 efree(callback_data); in zend_ffi_callback_hash_dtor()
943 zend_ffi_callback_data *callback_data = (zend_ffi_callback_data*)data; in zend_ffi_callback_trampoline() local
952 fci.params = do_alloca(sizeof(zval) *callback_data->arg_count, use_heap); in zend_ffi_callback_trampoline()
954 fci.param_count = callback_data->arg_count; in zend_ffi_callback_trampoline()
957 if (callback_data->type->func.args) { in zend_ffi_callback_trampoline()
961 ZEND_HASH_PACKED_FOREACH_PTR(callback_data->type->func.args, arg_type) { in zend_ffi_callback_trampoline()
969 if (zend_call_function(&fci, &callback_data->fcc) != SUCCESS) { in zend_ffi_callback_trampoline()
973 if (callback_data->arg_count) { in zend_ffi_callback_trampoline()
976 for (n = 0; n < callback_data->arg_count; n++) { in zend_ffi_callback_trampoline()
986 ret_type = ZEND_FFI_TYPE(callback_data->type->func.ret_type); in zend_ffi_callback_trampoline()
1002 zend_ffi_callback_data *callback_data; in zend_ffi_create_callback() local
1026 callback_data = emalloc(sizeof(zend_ffi_callback_data) + sizeof(ffi_type*) * arg_count); in zend_ffi_create_callback()
1027 memcpy(&callback_data->fcc, &fcc, sizeof(zend_fcall_info_cache)); in zend_ffi_create_callback()
1028 callback_data->type = type; in zend_ffi_create_callback()
1029 callback_data->callback = callback; in zend_ffi_create_callback()
1030 callback_data->code = code; in zend_ffi_create_callback()
1031 callback_data->arg_count = arg_count; in zend_ffi_create_callback()
1039 callback_data->arg_types[n] = zend_ffi_get_type(arg_type); in zend_ffi_create_callback()
1040 if (!callback_data->arg_types[n]) { in zend_ffi_create_callback()
1043 if (callback_data->arg_types[i]->type == FFI_TYPE_STRUCT) { in zend_ffi_create_callback()
1044 efree(callback_data->arg_types[i]); in zend_ffi_create_callback()
1047 efree(callback_data); in zend_ffi_create_callback()
1054 callback_data->ret_type = zend_ffi_get_type(ZEND_FFI_TYPE(type->func.ret_type)); in zend_ffi_create_callback()
1055 if (!callback_data->ret_type) { in zend_ffi_create_callback()
1057 for (int i = 0; i < callback_data->arg_count; ++i) { in zend_ffi_create_callback()
1058 if (callback_data->arg_types[i]->type == FFI_TYPE_STRUCT) { in zend_ffi_create_callback()
1059 efree(callback_data->arg_types[i]); in zend_ffi_create_callback()
1062 efree(callback_data); in zend_ffi_create_callback()
1067 …if (ffi_prep_cif(&callback_data->cif, type->func.abi, callback_data->arg_count, callback_data->ret… in zend_ffi_create_callback()
1072 …if (ffi_prep_closure_loc(callback, &callback_data->cif, zend_ffi_callback_trampoline, callback_dat… in zend_ffi_create_callback()
1075 for (int i = 0; i < callback_data->arg_count; ++i) { in zend_ffi_create_callback()
1076 if (callback_data->arg_types[i]->type == FFI_TYPE_STRUCT) { in zend_ffi_create_callback()
1077 efree(callback_data->arg_types[i]); in zend_ffi_create_callback()
1080 if (callback_data->ret_type->type == FFI_TYPE_STRUCT) { in zend_ffi_create_callback()
1081 efree(callback_data->ret_type); in zend_ffi_create_callback()
1083 efree(callback_data); in zend_ffi_create_callback()
1092 zend_hash_next_index_insert_ptr(FFI_G(callbacks), callback_data); in zend_ffi_create_callback()