Remove now-unnecessary extra retain during heap object destruction.

RC_DEALLOCATING_BIT prevents re-entrance into the destructor 
due to balanced retain/release during destruction.


Swift SVN r19060
This commit is contained in:
Greg Parker
2014-06-21 00:36:44 +00:00
parent f43d120421
commit 6493bee517

View File

@@ -347,9 +347,6 @@ void swift::swift_retainUnowned(HeapObject *object) {
// Declared extern "C" LLVM_LIBRARY_VISIBILITY above.
void _swift_release_slow(HeapObject *object) {
// Bump the retain count so that retains/releases that occur during the
// destructor don't recursively destroy the object.
swift_retain_noresult(object);
asFullMetadata(object->metadata)->destroy(object);
}
@@ -366,7 +363,7 @@ void swift::_swift_deallocClassInstance(HeapObject *self) {
void swift::swift_deallocObject(HeapObject *object, size_t allocatedSize,
size_t allocatedAlignMask) {
assert(isAlignmentMask(allocatedAlignMask));
assert(object->refCount == (RC_INTERVAL|RC_DEALLOCATING_BIT));
assert(object->refCount == RC_DEALLOCATING_BIT);
#ifdef SWIFT_RUNTIME_CLOBBER_FREED_OBJECTS
memset_pattern8((uint8_t *)object + sizeof(HeapObject),
"\xAB\xAD\x1D\xEA\xF4\xEE\xD0\bB9",