ObjFW  Check-in [05e2b4b851]

Overview
Comment:-[OFObject release]: Add memory barriers
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 05e2b4b8515985ea2adf74fc5908a641a40fc1a9d7187b92a37db99011085c30
User & Date: js on 2017-04-13 13:30:00
Other Links: manifest | tags
Context
2017-04-14
02:16
runtime: Add support for emergency exceptions check-in: 13c2017326 user: js tags: trunk
2017-04-13
13:30
-[OFObject release]: Add memory barriers check-in: 05e2b4b851 user: js tags: trunk
13:19
Clean up memory barriers check-in: 48ffea9a9a user: js tags: trunk
Changes

Modified src/OFObject.m from [349066991f] to [8d7351b7a0].

979
980
981
982
983
984
985


986



987

988
989
990
991
992
993
994
979
980
981
982
983
984
985
986
987

988
989
990
991
992
993
994
995
996
997
998
999







+
+
-
+
+
+

+







	assert(PRE_IVARS->retainCount >= 0);
	return PRE_IVARS->retainCount;
}

- (void)release
{
#if defined(OF_HAVE_ATOMIC_OPS)
	of_memory_barrier_release();

	if (of_atomic_int_dec(&PRE_IVARS->retainCount) <= 0)
	if (of_atomic_int_dec(&PRE_IVARS->retainCount) <= 0) {
		of_memory_barrier_acquire();

		[self dealloc];
	}
#else
	size_t c;

	OF_ENSURE(of_spinlock_lock(&PRE_IVARS->retainCountSpinlock));
	c = --PRE_IVARS->retainCount;
	OF_ENSURE(of_spinlock_unlock(&PRE_IVARS->retainCountSpinlock));