diff options
author | Benjamin Otte <otte@redhat.com> | 2020-01-24 00:43:26 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2020-01-28 02:17:03 +0100 |
commit | 146b9212462b8a8ba8eb5c162bc667fe5a792bb0 (patch) | |
tree | b1b9088c9fe8a062da4d3f8b322987a5301e4c87 /gtk/gtkcssnodeprivate.h | |
parent | 8b93ea9238bcbb99f6caadca9f6ef1d422926a35 (diff) | |
download | gtk+-146b9212462b8a8ba8eb5c162bc667fe5a792bb0.tar.gz |
cssnode: Convert name + id from interned string to GQuark
The reason for this is simply that I want to get hash functions that
have their values close together, so they can fit in a smaller range
(the goal here is 12 bits). By using GQuark, we get consecutive numbers
starting with 1 (and applications have <1000 quarks usually), whereas
interned strings can be all over the place.
As a side effect we also save 64 bytes per declaration.
Diffstat (limited to 'gtk/gtkcssnodeprivate.h')
-rw-r--r-- | gtk/gtkcssnodeprivate.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkcssnodeprivate.h b/gtk/gtkcssnodeprivate.h index 9f49e09b65..0dab08ab72 100644 --- a/gtk/gtkcssnodeprivate.h +++ b/gtk/gtkcssnodeprivate.h @@ -114,11 +114,11 @@ void gtk_css_node_set_visible (GtkCssNode * gboolean gtk_css_node_get_visible (GtkCssNode *cssnode) G_GNUC_PURE; void gtk_css_node_set_name (GtkCssNode *cssnode, - /*interned*/const char*name); -/*interned*/const char *gtk_css_node_get_name (GtkCssNode *cssnode) G_GNUC_PURE; + GQuark name); +GQuark gtk_css_node_get_name (GtkCssNode *cssnode) G_GNUC_PURE; void gtk_css_node_set_id (GtkCssNode *cssnode, - /*interned*/const char*id); -/*interned*/const char *gtk_css_node_get_id (GtkCssNode *cssnode) G_GNUC_PURE; + GQuark id); +GQuark gtk_css_node_get_id (GtkCssNode *cssnode) G_GNUC_PURE; void gtk_css_node_set_state (GtkCssNode *cssnode, GtkStateFlags state_flags); GtkStateFlags gtk_css_node_get_state (GtkCssNode *cssnode) G_GNUC_PURE; |