After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 755961 - Fix up annotations in gbytes.c
Fix up annotations in gbytes.c
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: introspection
unspecified
Other All
: Normal minor
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 702755
 
 
Reported: 2015-10-01 22:10 UTC by Mikhail Zabaluev
Modified: 2015-10-02 08:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gbytes: fix up annotations (3.73 KB, patch)
2015-10-01 22:10 UTC, Mikhail Zabaluev
accepted-commit_now Details | Review
Skip g_bytes_new_with_free_func() in introspection (852 bytes, patch)
2015-10-01 22:10 UTC, Mikhail Zabaluev
accepted-commit_now Details | Review

Description Mikhail Zabaluev 2015-10-01 22:10:21 UTC
A few improvements to fix incorrect or unsafe introspection data on GBytes.
Comment 1 Mikhail Zabaluev 2015-10-01 22:10:25 UTC
Created attachment 312534 [details] [review]
gbytes: fix up annotations

Annotate array elements as bytes.
Annotate a missed output parameter.
Replace (allow-none) with the corresponding modern annotations.
Comment 2 Mikhail Zabaluev 2015-10-01 22:10:31 UTC
Created attachment 312535 [details] [review]
Skip g_bytes_new_with_free_func() in introspection

The tricky ownership/mutability semantics on data make this function
unusable in introspection.
Comment 3 Colin Walters 2015-10-02 01:13:32 UTC
Review of attachment 312534 [details] [review]:

OK.
Comment 4 Colin Walters 2015-10-02 01:14:24 UTC
Review of attachment 312535 [details] [review]:

In theory (transfer full) on the input values...though I think that just ends up causing bindings to do a copy, which misses the point.
Comment 5 Mikhail Zabaluev 2015-10-02 08:24:51 UTC
(In reply to Colin Walters from comment #4)
> Review of attachment 312535 [details] [review] [review]:
> 
> In theory (transfer full) on the input values...though I think that just
> ends up causing bindings to do a copy, which misses the point.

There is also a DestroyNotify that the bindings need to supply in order to have the data freed.