* gir/gimarshallingtests.[hc]: Add a test for GStrv in function args and
as struct fields.
* girepository/giroffsets.c: Correctly compute the size of structs with
array fields
* girepository/girparser.c: Set is_pointer to FALSE for arrays with
fixed size that are inside structs.
* giscanner/glibtransformer.py: Special case GStrv as arrays of utf8.
* giscanner/annotationparser.py: Make full transfer the default for
arrays of char* returned by functions.
https://bugzilla.gnome.org/show_bug.cgi?id=620170
Split out GIBaseInfo to a separate source file.
Move out definitions to gibaseinfo.h/gitypelib.h/gitypes.h
and girepository-private.h
Install gibaseinfo.h/gitypelib.h and gitypes.h as well, but
require users to include girepository.h
We need to support parsing older .girs for inclusion purposes. (But
we should probably have an explicit .gir version, and require the
attribute for newer versions)
People have wanted support for marking (out) on functions of the
form:
/**
* clutter_color_from_pixel:
* @pixel: A pixel
* @color: (out): Color to initialize with value of @pixel
*/
void
clutter_color_from_pixel (guint32 pixel, ClutterColor *color);
Where the caller is supposed to have allocated the argument; the
C function just initializes it. This patch adds support for this
argument passing style to introspection. In this case, we see the
(out), and notice that there's only a single indirection (*) on
the argument, and assume that this means (out caller-allocates).
https://bugzilla.gnome.org/show_bug.cgi?id=604749
Use g_slice to allocate instead of g_new(x, 1); It uses a memory
pool internally and should be faster, especially for GBaseInfo/GRealInfo,
structs which are tiny.
Make the language we use in the gtk-doc comments
more consistent. Add transfer annotation for all functions
returning a struct and mention how they should be freed.
This restores the reverted-commit ed8634d:
Author: Dan Winship <danw@gnome.org>
Date: Mon Apr 5 14:05:52 2010 -0400
g_callable_info_prepare_closure: handle mmap permissions error
When SELinux or similar is active, a process may not be able to mmap()
a segment that is both writable and executable, which would causing
g_callable_info_prepare_closure() to fail. Libffi has a workaround for
this problem though (it maps the same non-anonymous region twice, once
writable and once executable, and returns two separate pointers to
it), so use that.
But with an added fix, when using ffi_closure_alloc(), we need to use
ffi_prep_closure_loc() so we can pass in the executable address of the
trampoline separately from the writable address, rather than the
deprecated ffi_prep_closure().
https://bugzilla.gnome.org/show_bug.cgi?id=615105
This reverts commit ed8634ddf73a56cb1935fd87254b3c6c04352893.
This commit caused crashes in gjs/gnome-shell, which we're still trying
to track down. See: http://bugzilla.gnome.org/615078
When SELinux or similar is active, a process may not be able to mmap()
a segment that is both writable and executable, which would causing
g_callable_info_prepare_closure() to fail. Libffi has a workaround for
this problem though (it maps the same non-anonymous region twice, once
writable and once executable, and returns two separate pointers to
it), so use that.
https://bugzilla.gnome.org/show_bug.cgi?id=614903
Foreign structs are special in the sense that there might
be native bindings (for instance PyCairo for PyGI) that provides
the same functionallity as the introspected variant.
https://bugzilla.gnome.org/show_bug.cgi?id=610357
To make things really better we should track the line origin of
element from the .gir file (and actually we need to do better
checking in the scanner), but this is slightly less lame.
When looking at an embedded type (e.g. a Callback after a Field), the
offset we put in the info structure was to the CallbackBlob itself.
However the code in g_type_info_get_interface assumed that the offset
was to a SimpleTypeBlob, which it wasn't.
https://bugzilla.gnome.org/show_bug.cgi?id=606180
We don't want to malloc each GIBaseInfo when they can be used in
function invocation; instead, allow stack allocation.
There were a lot of structure typedefs which were actually just
exactly the same as GIBaseInfo, with the one exception of GITypeInfo.
Instead, just put the single GITypeInfo boolean inside GIBaseInfo
as a bit in a bitfield.
GIBaseInfo is still opaque publicly; GIRealInfo is the new
internal structure.
Using this, add new functions to retrieve arguments and argument types
on the stack.
https://bugzilla.gnome.org/show_bug.cgi?id=604074
Rather than having bindings use g_function_info_invoke, which is basically
a toy/demo API, export a convenience utility function which takes the introspection
information and sets up things we need to pass to libffi.
Then invocation can be done directly to libffi by a binding.
As part of this work, remove some (unused by gjs) public functions from the
girffi API, and instead export a function to map to libffi which can work
semi-correctly.
https://bugzilla.gnome.org/show_bug.cgi?id=604074