X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/6b200bc335dc93c5516ccb52f14bd896d8c7fad7..refs/heads/master:/OSX/libsecurity_utilities/lib/seccfobject.cpp diff --git a/OSX/libsecurity_utilities/lib/seccfobject.cpp b/OSX/libsecurity_utilities/lib/seccfobject.cpp index 9fcfc7c0..04972e7c 100644 --- a/OSX/libsecurity_utilities/lib/seccfobject.cpp +++ b/OSX/libsecurity_utilities/lib/seccfobject.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -111,7 +112,7 @@ void SecPointerBase::copy(SecCFObject * p) // SecCFObject // SecCFObject * -SecCFObject::optional(CFTypeRef cfTypeRef) throw() +SecCFObject::optional(CFTypeRef cfTypeRef) _NOEXCEPT { if (!cfTypeRef) return NULL; @@ -130,7 +131,7 @@ SecCFObject::required(CFTypeRef cfTypeRef, OSStatus error) } void * -SecCFObject::allocate(size_t size, const CFClass &cfclass) throw(std::bad_alloc) +SecCFObject::allocate(size_t size, const CFClass &cfclass) { CFTypeRef p = _CFRuntimeCreateInstance(NULL, cfclass.typeID, size + kAlignedRuntimeSize - sizeof(CFRuntimeBase), NULL); @@ -145,7 +146,7 @@ SecCFObject::allocate(size_t size, const CFClass &cfclass) throw(std::bad_alloc) } void -SecCFObject::operator delete(void *object) throw() +SecCFObject::operator delete(void *object) _NOEXCEPT { CFTypeRef cfType = reinterpret_cast(reinterpret_cast(object) - kAlignedRuntimeSize); @@ -156,12 +157,12 @@ SecCFObject::operator delete(void *object) throw() SecCFObject::SecCFObject() { mRetainCount = 1; - mRetainSpinLock = OS_SPINLOCK_INIT; + mRetainLock = OS_UNFAIR_LOCK_INIT; } uint32_t SecCFObject::updateRetainCount(intptr_t direction, uint32_t *oldCount) { - OSSpinLockLock(&mRetainSpinLock); + os_unfair_lock_lock(&mRetainLock); if (oldCount != NULL) { @@ -179,7 +180,7 @@ uint32_t SecCFObject::updateRetainCount(intptr_t direction, uint32_t *oldCount) uint32_t result = mRetainCount; - OSSpinLockUnlock(&mRetainSpinLock); + os_unfair_lock_unlock(&mRetainLock); return result; } @@ -216,7 +217,7 @@ SecCFObject::copyDebugDesc() } CFTypeRef -SecCFObject::handle(bool retain) throw() +SecCFObject::handle(bool retain) _NOEXCEPT { CFTypeRef cfType = *this; if (retain && !isNew()) CFRetain(cfType);