Skip to content
Commit 47381c92 authored by Colin Walters's avatar Colin Walters
Browse files

Optimize function invocation, fix allocation cleanup

Rather than using the "toy" API g_function_info_invoke, looking up
the function info each time, cache the prepared libffi cif inside
Function.  This applies to method invocations; constructors still
fall back to a slow path.

Introspection now supports a stack-allocated API for getting
argument information; use it and avoid malloc'ing repeatedly
in the invocation fast path.

The way processing failure was handled was pretty broken; we had
just a single global "failed" argument, which we set to TRUE if
at any point something failed.

But this would cause memory leaks if for example we failed in the
middle of releasing input arguments; we'd never free the remaining
args.

Clean this up by introducing different variables which we use at
different points.

https://bugzilla.gnome.org/show_bug.cgi?id=604076
parent 5c8e08bc
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment