diff options
author | Colin Walters <walters@src.gnome.org> | 2008-10-02 21:24:24 +0000 |
---|---|---|
committer | Colin Walters <walters@src.gnome.org> | 2008-10-02 21:24:24 +0000 |
commit | a1d5a4ef31de26db226da537b8c188a02a06ef63 (patch) | |
tree | c9eccf670f386736e8cd2a79cbef968c2e0cbe22 /girepository/ginvoke.c | |
parent | 549492441fd273233a929c51a6fd9c9d764a8ba4 (diff) | |
download | gobject-introspection-a1d5a4ef31de26db226da537b8c188a02a06ef63.tar.gz |
Use g_alloca, suggested by Havoc Pennington
svn path=/trunk/; revision=649
Diffstat (limited to 'girepository/ginvoke.c')
-rw-r--r-- | girepository/ginvoke.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/girepository/ginvoke.c b/girepository/ginvoke.c index c2eba44a..c9180d9f 100644 --- a/girepository/ginvoke.c +++ b/girepository/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; } |