Lines Matching refs:callback_data
861 zend_ffi_callback_data *callback_data = Z_PTR_P(zv); in zend_ffi_callback_hash_dtor() local
863 ffi_closure_free(callback_data->callback); in zend_ffi_callback_hash_dtor()
864 if (callback_data->fcc.function_handler->common.fn_flags & ZEND_ACC_CLOSURE) { in zend_ffi_callback_hash_dtor()
865 OBJ_RELEASE(ZEND_CLOSURE_OBJECT(callback_data->fcc.function_handler)); in zend_ffi_callback_hash_dtor()
867 for (int i = 0; i < callback_data->arg_count; ++i) { in zend_ffi_callback_hash_dtor()
868 if (callback_data->arg_types[i]->type == FFI_TYPE_STRUCT) { in zend_ffi_callback_hash_dtor()
869 efree(callback_data->arg_types[i]); in zend_ffi_callback_hash_dtor()
872 if (callback_data->ret_type->type == FFI_TYPE_STRUCT) { in zend_ffi_callback_hash_dtor()
873 efree(callback_data->ret_type); in zend_ffi_callback_hash_dtor()
875 efree(callback_data); in zend_ffi_callback_hash_dtor()
881 zend_ffi_callback_data *callback_data = (zend_ffi_callback_data*)data; in zend_ffi_callback_trampoline() local
890 fci.params = do_alloca(sizeof(zval) *callback_data->arg_count, use_heap); in zend_ffi_callback_trampoline()
892 fci.param_count = callback_data->arg_count; in zend_ffi_callback_trampoline()
895 if (callback_data->type->func.args) { in zend_ffi_callback_trampoline()
899 ZEND_HASH_FOREACH_PTR(callback_data->type->func.args, arg_type) { in zend_ffi_callback_trampoline()
907 if (zend_call_function(&fci, &callback_data->fcc) != SUCCESS) { in zend_ffi_callback_trampoline()
911 if (callback_data->arg_count) { in zend_ffi_callback_trampoline()
914 for (n = 0; n < callback_data->arg_count; n++) { in zend_ffi_callback_trampoline()
924 ret_type = ZEND_FFI_TYPE(callback_data->type->func.ret_type); in zend_ffi_callback_trampoline()
940 zend_ffi_callback_data *callback_data; in zend_ffi_create_callback() local
964 callback_data = emalloc(sizeof(zend_ffi_callback_data) + sizeof(ffi_type*) * arg_count); in zend_ffi_create_callback()
965 memcpy(&callback_data->fcc, &fcc, sizeof(zend_fcall_info_cache)); in zend_ffi_create_callback()
966 callback_data->type = type; in zend_ffi_create_callback()
967 callback_data->callback = callback; in zend_ffi_create_callback()
968 callback_data->code = code; in zend_ffi_create_callback()
969 callback_data->arg_count = arg_count; in zend_ffi_create_callback()
977 callback_data->arg_types[n] = zend_ffi_get_type(arg_type); in zend_ffi_create_callback()
978 if (!callback_data->arg_types[n]) { in zend_ffi_create_callback()
981 if (callback_data->arg_types[i]->type == FFI_TYPE_STRUCT) { in zend_ffi_create_callback()
982 efree(callback_data->arg_types[i]); in zend_ffi_create_callback()
985 efree(callback_data); in zend_ffi_create_callback()
992 callback_data->ret_type = zend_ffi_get_type(ZEND_FFI_TYPE(type->func.ret_type)); in zend_ffi_create_callback()
993 if (!callback_data->ret_type) { in zend_ffi_create_callback()
995 for (int i = 0; i < callback_data->arg_count; ++i) { in zend_ffi_create_callback()
996 if (callback_data->arg_types[i]->type == FFI_TYPE_STRUCT) { in zend_ffi_create_callback()
997 efree(callback_data->arg_types[i]); in zend_ffi_create_callback()
1000 efree(callback_data); in zend_ffi_create_callback()
1005 …if (ffi_prep_cif(&callback_data->cif, type->func.abi, callback_data->arg_count, callback_data->ret… in zend_ffi_create_callback()
1010 …if (ffi_prep_closure_loc(callback, &callback_data->cif, zend_ffi_callback_trampoline, callback_dat… in zend_ffi_create_callback()
1013 for (int i = 0; i < callback_data->arg_count; ++i) { in zend_ffi_create_callback()
1014 if (callback_data->arg_types[i]->type == FFI_TYPE_STRUCT) { in zend_ffi_create_callback()
1015 efree(callback_data->arg_types[i]); in zend_ffi_create_callback()
1018 if (callback_data->ret_type->type == FFI_TYPE_STRUCT) { in zend_ffi_create_callback()
1019 efree(callback_data->ret_type); in zend_ffi_create_callback()
1021 efree(callback_data); in zend_ffi_create_callback()
1030 zend_hash_next_index_insert_ptr(FFI_G(callbacks), callback_data); in zend_ffi_create_callback()