gobject: Drop unnecessary volatile qualifiers from internal variables

These variables were already (correctly) accessed atomically. The
`volatile` qualifier doesn’t help with that.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #600
This commit is contained in:
Philip Withnall 2020-11-11 18:42:43 +00:00
parent 1314ff93fc
commit 08d04d0428
4 changed files with 18 additions and 18 deletions

View File

@ -98,7 +98,7 @@
typedef union { typedef union {
GClosure closure; GClosure closure;
volatile gint vint; gint vint;
} ClosureInt; } ClosureInt;
#define CHANGE_FIELD(_closure, _field, _OP, _value, _must_set, _SET_OLD, _SET_NEW) \ #define CHANGE_FIELD(_closure, _field, _OP, _value, _must_set, _SET_OLD, _SET_NEW) \

View File

@ -175,20 +175,20 @@ struct _GClosureNotifyData
struct _GClosure struct _GClosure
{ {
/*< private >*/ /*< private >*/
volatile guint ref_count : 15; guint ref_count : 15; /* (atomic) */
/* meta_marshal is not used anymore but must be zero for historical reasons /* meta_marshal is not used anymore but must be zero for historical reasons
as it was exposed in the G_CLOSURE_N_NOTIFIERS macro */ as it was exposed in the G_CLOSURE_N_NOTIFIERS macro */
volatile guint meta_marshal_nouse : 1; guint meta_marshal_nouse : 1; /* (atomic) */
volatile guint n_guards : 1; guint n_guards : 1; /* (atomic) */
volatile guint n_fnotifiers : 2; /* finalization notifiers */ guint n_fnotifiers : 2; /* finalization notifiers (atomic) */
volatile guint n_inotifiers : 8; /* invalidation notifiers */ guint n_inotifiers : 8; /* invalidation notifiers (atomic) */
volatile guint in_inotify : 1; guint in_inotify : 1; /* (atomic) */
volatile guint floating : 1; guint floating : 1; /* (atomic) */
/*< protected >*/ /*< protected >*/
volatile guint derivative_flag : 1; guint derivative_flag : 1; /* (atomic) */
/*< public >*/ /*< public >*/
volatile guint in_marshal : 1; guint in_marshal : 1; /* (atomic) */
volatile guint is_invalid : 1; guint is_invalid : 1; /* (atomic) */
/*< private >*/ void (*marshal) (GClosure *closure, /*< private >*/ void (*marshal) (GClosure *closure,
GValue /*out*/ *return_value, GValue /*out*/ *return_value,

View File

@ -174,9 +174,9 @@ typedef struct
GTypeInstance g_type_instance; GTypeInstance g_type_instance;
/*< private >*/ /*< private >*/
volatile guint ref_count; guint ref_count; /* (atomic) */
#ifdef HAVE_OPTIONAL_FLAGS #ifdef HAVE_OPTIONAL_FLAGS
volatile guint optional_flags; guint optional_flags; /* (atomic) */
#endif #endif
GData *qdata; GData *qdata;
} GObjectReal; } GObjectReal;

View File

@ -221,9 +221,9 @@ typedef enum
/* --- structures --- */ /* --- structures --- */
struct _TypeNode struct _TypeNode
{ {
guint volatile ref_count; guint ref_count; /* (atomic) */
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
guint volatile instance_count; guint instance_count; /* (atomic) */
#endif #endif
GTypePlugin *plugin; GTypePlugin *plugin;
guint n_children; /* writable with lock */ guint n_children; /* writable with lock */
@ -233,7 +233,7 @@ struct _TypeNode
guint is_instantiatable : 1; guint is_instantiatable : 1;
guint mutatable_check_cache : 1; /* combines some common path checks */ guint mutatable_check_cache : 1; /* combines some common path checks */
GType *children; /* writable with lock */ GType *children; /* writable with lock */
TypeData * volatile data; TypeData *data;
GQuark qname; GQuark qname;
GData *global_gdata; GData *global_gdata;
union { union {
@ -569,8 +569,8 @@ type_node_new_W (TypeNode *pnode,
} }
static inline IFaceEntry* static inline IFaceEntry*
lookup_iface_entry_I (volatile IFaceEntries *entries, lookup_iface_entry_I (IFaceEntries *entries,
TypeNode *iface_node) TypeNode *iface_node)
{ {
guint8 *offsets; guint8 *offsets;
guint offset_index; guint offset_index;