Determining the newly_constructed boolean in gobject.c can be done faster
Submitted by Philip Van Hoof
Link to original bug (#557151)
Description
+++ This bug was initially created as a clone of Bug #553794 +++
This is the second part of the patch that was being proposed in Bug #553794, Attachment #120520.
The other part of the patch is now cloned to Bug# 557100.
The comments so far about this part of the patch are that instead of using obj->ref_count it would be better if TLS would be used (http://people.redhat.com/drepper/tls.pdf) instead of consuming one bit of the obj->ref_count field as a hack.
For correctness I have replaced the old implementation which was not using memory barriers with one that does. In this patch it's already the case that g_atomic_int_get and g_atomic_int_compare_and_exchange are being used.
Because this version of bugzilla doesn't allow me to immediately attach a patch, the patch will be attached immediately after submitting.