X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Flibffi.c;h=fe2bc614b2c2bc21617cc0c73dcf4120a3cad445;hb=d4bd55e7d9b1cf63cd6fdc96b70010a0c2aca963;hp=6f808d4ce2360c4d1ba49079682e247a6fa72417;hpb=14969a8b4386d7c38e90775e1c57886c9bf3839e;p=m6w6%2Fext-psi diff --git a/src/libffi.c b/src/libffi.c index 6f808d4..fe2bc61 100644 --- a/src/libffi.c +++ b/src/libffi.c @@ -229,10 +229,15 @@ static bool psi_ffi_init(struct psi_context *C) { ffi_status rc; struct psi_ffi_context *context = pecalloc(1, sizeof(*context), 1); + ffi_abi abi = FFI_DEFAULT_ABI; + +#if HAVE_FFI_FASTCALL + abi = FFI_FASTCALL; +#endif context->params[0] = &ffi_type_pointer; context->params[1] = &ffi_type_pointer; - rc = ffi_prep_cif(&context->signature, FFI_DEFAULT_ABI, 2, &ffi_type_void, + rc = ffi_prep_cif(&context->signature, abi, 2, &ffi_type_void, context->params); if (FFI_OK != rc) { @@ -292,22 +297,6 @@ static void psi_ffi_composite_dtor(struct psi_context *C, darg->engine.info = NULL; darg->engine.type = NULL; - struct psi_plist *args = NULL; - struct psi_decl_type *dtype = psi_decl_type_get_real(darg->type); - - if (dtype->type == PSI_T_STRUCT) { - args = dtype->real.strct->args; - } else if (dtype->type == PSI_T_UNION) { - args = dtype->real.unn->args; - } - - size_t i = 0; - struct psi_decl_arg *tmp; - - while (psi_plist_get(args, i++, &tmp)) { - psi_ffi_composite_dtor(C, tmp); - } - psi_plist_free(info->eles); pefree(info, 1); }