forked from gnustep/libobjc2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid dangling weak references to deallocating objects.
The previous checks for a deallocating object with negative reference count did not work because: 1. the sign bit has to be recreated as was happening in objc_delete_weak_refs() 2. there was no distinction between a saturated count and a negative reference count refcount_max now indicates when the refcount has saturated and should no longer be mutated. An underflow to -1 still maps to refcount_mask, allowing us to detect when an object is supposed to be deallocated. Neither objc_release_fast_no_destroy_np() nor objc_retain_fast_np() mutate the refcount when it is one of those values, so the comment in objc_delete_weak_refs() was adjusted.
- Loading branch information
Showing
1 changed file
with
13 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters