summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2020-09-29 15:57:33 +0200
committerAlexander Larsson <alexl@redhat.com>2020-09-29 15:57:33 +0200
commit8a0dd452d2d9141e68f2d5eb82475735adb7c861 (patch)
tree9db4ffaad26c2dd0451dafecb1d9b6361a43442d
parent2e5caa68bc5b37fdf1b808b304c6d5499f21ab48 (diff)
downloadgtk+-8a0dd452d2d9141e68f2d5eb82475735adb7c861.tar.gz
gdkarray: Inline splice and reserve
This inlines the splice and reserver GdkArray calls. These are typically only called from the gdk_array_(append/set_size) functions anyway, and inlining the caller means we can constant propagate the constant arguments in those calls. Its hard to get exact numbers, but in fishbowl i noticed a significant decrease in the time spent in the array code when pushing and poping states.
-rw-r--r--gdk/gdkarrayimpl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdk/gdkarrayimpl.c b/gdk/gdkarrayimpl.c
index 6692245aa7..65b74a3f59 100644
--- a/gdk/gdkarrayimpl.c
+++ b/gdk/gdkarrayimpl.c
@@ -141,7 +141,7 @@ gdk_array(is_empty) (const GdkArray *self)
return self->end == self->start;
}
-G_GNUC_UNUSED static void
+G_GNUC_UNUSED static inline void
gdk_array(reserve) (GdkArray *self,
gsize n)
{
@@ -178,7 +178,7 @@ gdk_array(reserve) (GdkArray *self,
#endif
}
-G_GNUC_UNUSED static void
+G_GNUC_UNUSED static inline void
gdk_array(splice) (GdkArray *self,
gsize pos,
gsize removed,