summaryrefslogtreecommitdiff
path: root/girepository/gitypelib-internal.h
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2014-02-27 17:10:19 -0800
committerColin Walters <walters@verbum.org>2015-10-10 17:41:24 -0400
commitdf21d1f362a810f48a23b7c121bf09ce398539c7 (patch)
treeb5fd8d369bacdb4a9cea40f4a5421321a38c5007 /girepository/gitypelib-internal.h
parent0aa60a43c4c9679668e15dbf3ef7a39016525150 (diff)
downloadgobject-introspection-df21d1f362a810f48a23b7c121bf09ce398539c7.tar.gz
girepository: Use constant time calculation for sections after Object fields
Add "n_field_callbacks" to ObjectBlob which represents the number of object fields which are also callbacks. This a allows a constant time computation for accessing sections after fields. Track writing of this field by passing an extra argument through the girnode writers recursive call structure. This essentally reverts a portion of commit 7027bb256d0d1ab which added a linear time computation for accessing sections after fields. Update typelib validator to also ensure n_field_callbacks is properly set. https://bugzilla.gnome.org/show_bug.cgi?id=700338
Diffstat (limited to 'girepository/gitypelib-internal.h')
-rw-r--r--girepository/gitypelib-internal.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/girepository/gitypelib-internal.h b/girepository/gitypelib-internal.h
index 5ccff719..0f105127 100644
--- a/girepository/gitypelib-internal.h
+++ b/girepository/gitypelib-internal.h
@@ -1051,7 +1051,8 @@ typedef struct {
* @n_constants: The lengths of the arrays.Up to 16bits of padding may be
* inserted between the arrays to ensure that they start on a 32bit
* boundary.
- * @reserved2: Reserved for future use.
+ * @n_field_callbacks: The number of n_fields which are also callbacks.
+ * This is used to calculate the fields section size in constant time.
* @ref_func: String pointing to a function which can be called to increase
* the reference count for an instance of this object type.
* @unref_func: String pointing to a function which can be called to decrease
@@ -1088,7 +1089,7 @@ typedef struct {
guint16 n_signals;
guint16 n_vfuncs;
guint16 n_constants;
- guint16 reserved2;
+ guint16 n_field_callbacks;
guint32 ref_func;
guint32 unref_func;