#include <security_utilities/threading.h>
#include <CoreFoundation/CFString.h>
#include <sys/time.h>
-#include <auto_zone.h>
-#include <objc/objc-auto.h>
//
// CFClass
// the default is to not throw away the object
zap = false;
- bool isGC = CF_IS_COLLECTABLE(cf);
-
uint32_t currentCount;
SecCFObject *obj = SecCFObject::optional(cf);
uint32_t oldCount;
currentCount = obj->updateRetainCount(op, &oldCount);
-
- if (isGC)
- {
- auto_zone_t* zone = objc_collectableZone();
-
- if (op == -1 && oldCount == 0)
- {
- auto_zone_release(zone, (void*) cf);
- }
- else if (op == 1 && oldCount == 0 && currentCount == 1)
- {
- auto_zone_retain(zone, (void*) cf);
- }
- else if (op == -1 && oldCount == 1 && currentCount == 0)
- {
- /*
- To prevent accidental resurrection, just pull it out of the
- cache.
- */
- obj->aboutToDestruct();
- auto_zone_release(zone, (void*) cf);
- }
- else if (op == 0)
- {
- return currentCount;
- }
-
- return 0;
- }
if (op == 0)
{
}
uint32_t
-CFClass::refCountForType(intptr_t op, CFTypeRef cf) throw()
+CFClass::refCountForType(intptr_t op, CFTypeRef cf) _NOEXCEPT
{
uint32_t result = 0;
bool zap = false;
void
-CFClass::finalizeType(CFTypeRef cf) throw()
+CFClass::finalizeType(CFTypeRef cf) _NOEXCEPT
{
/*
- Why are we asserting the mutex here as well as in refCountForType?
- Because the way we control the objects and the queues are different
- under GC than they are under non-GC operations.
-
- In non-GC, we need to control the lifetime of the object. This means
+ We need to control the lifetime of the object. This means
that the cache lock has to be asserted while we are determining if the
object should live or die. The mutex is recursive, which means that
we won't end up with mutex inversion.
-
- In GC, GC figures out the lifetime of the object. We probably don't need
- to assert the mutex here, but it doesn't hurt.
*/
SecCFObject *obj = SecCFObject::optional(cf);
- bool isCollectable = CF_IS_COLLECTABLE(cf);
-
try
{
Mutex* mutex = obj->getMutexForObject();
catch(...)
{
}
-
- if (isCollectable)
- {
- delete obj;
- }
}
Boolean
-CFClass::equalType(CFTypeRef cf1, CFTypeRef cf2) throw()
+CFClass::equalType(CFTypeRef cf1, CFTypeRef cf2) _NOEXCEPT
{
// CF checks for pointer equality and ensures type equality already
try {
}
CFHashCode
-CFClass::hashType(CFTypeRef cf) throw()
+CFClass::hashType(CFTypeRef cf) _NOEXCEPT
{
try {
return SecCFObject::optional(cf)->hash();
}
CFStringRef
-CFClass::copyFormattingDescType(CFTypeRef cf, CFDictionaryRef dict) throw()
+CFClass::copyFormattingDescType(CFTypeRef cf, CFDictionaryRef dict) _NOEXCEPT
{
try {
return SecCFObject::optional(cf)->copyFormattingDesc(dict);
}
CFStringRef
-CFClass::copyDebugDescType(CFTypeRef cf) throw()
+CFClass::copyDebugDescType(CFTypeRef cf) _NOEXCEPT
{
try {
return SecCFObject::optional(cf)->copyDebugDesc();