From aceef77051a27d10c7432dae5ef534ba3d03eee2 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 2 Oct 2008 21:24:24 +0000 Subject: [PATCH] Use g_alloca, suggested by Havoc Pennington svn path=/trunk/; revision=649 --- ginvoke.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ginvoke.c b/ginvoke.c index c2eba44a3..c9180d9f5 100644 --- a/ginvoke.c +++ b/ginvoke.c @@ -226,8 +226,8 @@ g_function_info_invoke (GIFunctionInfo *info, } else n_invoke_args = n_args; - atypes = g_new (ffi_type*, n_invoke_args); - args = g_new (gpointer, n_invoke_args); + atypes = g_alloca (sizeof (ffi_type*) * n_invoke_args); + args = g_alloca (sizeof (gpointer) * n_invoke_args); if (is_method) { @@ -326,10 +326,6 @@ g_function_info_invoke (GIFunctionInfo *info, ffi_call (&cif, func, return_value, args); success = TRUE; - out: - g_free (atypes); - g_free (args); - return success; }