Fix atomic-int op on Apple
The OSAtomicAdd32Barrier operator returns the new value, we want the old value.
This commit is contained in:
parent
a1970d9afc
commit
bc71ad4973
|
@ -301,7 +301,7 @@ _try_writable (hb_blob_t *blob)
|
|||
return TRUE;
|
||||
|
||||
|
||||
DEBUG_MSG_FUNC (BLOB, blob, "currect data is -> %p\n", blob->data);
|
||||
DEBUG_MSG_FUNC (BLOB, blob, "current data is -> %p\n", blob->data);
|
||||
|
||||
char *new_data;
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ typedef long hb_atomic_int_t;
|
|||
|
||||
#include <libkern/OSAtomic.h>
|
||||
typedef int32_t hb_atomic_int_t;
|
||||
#define hb_atomic_int_add(AI, V) OSAtomicAdd32Barrier(V, &(AI))
|
||||
#define hb_atomic_int_add(AI, V) (OSAtomicAdd32Barrier((V), &(AI)), (AI) - (V))
|
||||
#define hb_atomic_int_get(AI) OSAtomicAdd32Barrier(0, &(AI))
|
||||
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue