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/gtkcssnodedeclarationprivate.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/gtkcssnodedeclarationprivate.h')
-rw-r--r-- | gtk/gtkcssnodedeclarationprivate.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkcssnodedeclarationprivate.h b/gtk/gtkcssnodedeclarationprivate.h index 8609e4cac3..d0dd6e43fa 100644 --- a/gtk/gtkcssnodedeclarationprivate.h +++ b/gtk/gtkcssnodedeclarationprivate.h @@ -28,11 +28,11 @@ GtkCssNodeDeclaration * gtk_css_node_declaration_ref (GtkCssN void gtk_css_node_declaration_unref (GtkCssNodeDeclaration *decl); gboolean gtk_css_node_declaration_set_name (GtkCssNodeDeclaration **decl, - /*interned*/ const char *name); -/*interned*/ const char*gtk_css_node_declaration_get_name (const GtkCssNodeDeclaration *decl); + GQuark name); +GQuark gtk_css_node_declaration_get_name (const GtkCssNodeDeclaration *decl); gboolean gtk_css_node_declaration_set_id (GtkCssNodeDeclaration **decl, - const char *id); -const char * gtk_css_node_declaration_get_id (const GtkCssNodeDeclaration *decl); + GQuark id); +GQuark gtk_css_node_declaration_get_id (const GtkCssNodeDeclaration *decl); gboolean gtk_css_node_declaration_set_state (GtkCssNodeDeclaration **decl, GtkStateFlags flags); GtkStateFlags gtk_css_node_declaration_get_state (const GtkCssNodeDeclaration *decl); |