mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-09 02:10:10 +00:00
Merge branch 'snapshot-stack-optimize' into 'master'
Minor optimizations to GtkSnapshot state stack See merge request GNOME/gtk!2641
This commit is contained in:
commit
687ed74d46
@ -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,
|
||||
@ -208,8 +208,10 @@ gdk_array(splice) (GdkArray *self,
|
||||
memcpy (gdk_array(index) (self, pos),
|
||||
additions,
|
||||
added * sizeof (_T_));
|
||||
#ifndef GDK_ARRAY_NO_MEMSET
|
||||
else
|
||||
memset (gdk_array(index) (self, pos), 0, added * sizeof (_T_));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -279,5 +281,5 @@ gdk_array(get) (const GdkArray *self,
|
||||
#undef GDK_ARRAY_NULL_TERMINATED
|
||||
#undef GDK_ARRAY_PREALLOC
|
||||
#undef GDK_ARRAY_TYPE_NAME
|
||||
|
||||
#undef GDK_ARRAY_NO_MEMSET
|
||||
#endif
|
||||
|
@ -132,6 +132,8 @@ static void gtk_snapshot_state_clear (GtkSnapshotState *state);
|
||||
#define GDK_ARRAY_ELEMENT_TYPE GtkSnapshotState
|
||||
#define GDK_ARRAY_FREE_FUNC gtk_snapshot_state_clear
|
||||
#define GDK_ARRAY_BY_VALUE 1
|
||||
#define GDK_ARRAY_PREALLOC 16
|
||||
#define GDK_ARRAY_NO_MEMSET 1
|
||||
#include "gdk/gdkarrayimpl.c"
|
||||
|
||||
/* This is a nasty little hack. We typedef GtkSnapshot to the fake object GdkSnapshot
|
||||
|
Loading…
Reference in New Issue
Block a user