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 729167 - gobject: Document that classes/objects/interfaces are zero-filled
gobject: Document that classes/objects/interfaces are zero-filled
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: docs
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-04-29 07:49 UTC by Philip Withnall
Modified: 2014-04-29 09:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gobject: Document that classes/objects/interfaces are zero-filled (5.78 KB, patch)
2014-04-29 07:49 UTC, Philip Withnall
accepted-commit_now Details | Review
gobject: Document that classes/objects/interfaces are zero-filled (5.79 KB, patch)
2014-04-29 09:40 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2014-04-29 07:49:02 UTC
Patch added which documents this in a few (hopefully) obvious places.
Comment 1 Philip Withnall 2014-04-29 07:49:05 UTC
Created attachment 275402 [details] [review]
gobject: Document that classes/objects/interfaces are zero-filled

On initialisation, GObject guarantees to zero-fill
class/object/interface structures. Document this so people don’t spend
forever writing:
    my_object->priv->some_member = NULL;
    my_object->priv->some_other_member = NULL;
Comment 2 Allison Karlitskaya (desrt) 2014-04-29 08:57:22 UTC
Review of attachment 275402 [details] [review]:

Looks good, but please remove all uses of "implicit" from the additions (since it doesn't add anything and it may confuse).

implicit:
  1. suggested though not directly expressed
Comment 3 Philip Withnall 2014-04-29 09:40:38 UTC
Created attachment 275405 [details] [review]
gobject: Document that classes/objects/interfaces are zero-filled

On initialisation, GObject guarantees to zero-fill
class/object/interface structures. Document this so people don’t spend
forever writing:
    my_object->priv->some_member = NULL;
    my_object->priv->some_other_member = NULL;
Comment 4 Philip Withnall 2014-04-29 09:42:42 UTC
Comment on attachment 275405 [details] [review]
gobject: Document that classes/objects/interfaces are zero-filled

Merged to master with s/implicit/automatic/.

commit 704852ff097f848dcb89ba553431b460938d8d91
Author: Philip Withnall <philip.withnall@collabora.co.uk>
Date:   Tue Apr 29 08:47:14 2014 +0100

    gobject: Document that classes/objects/interfaces are zero-filled
    
    On initialisation, GObject guarantees to zero-fill
    class/object/interface structures. Document this so people don’t spend
    forever writing:
        my_object->priv->some_member = NULL;
        my_object->priv->some_other_member = NULL;
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729167

 docs/reference/gobject/tut_howto.xml |  9 ++++++---
 gobject/gtype.c                      | 11 +++++++++--
 gobject/gtype.h                      |  7 +++++++
 3 files changed, 22 insertions(+), 5 deletions(-)