mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Preliminary code for emulation of the objc2 runtime weak reference feature
This commit is contained in:
parent
950e2a5f07
commit
c66bd6ec5c
11 changed files with 472 additions and 81 deletions
|
@ -493,9 +493,7 @@ static BOOL objc_release_fast_no_destroy_internal(id anObject)
|
|||
* have been greater than zero)
|
||||
*/
|
||||
(((obj)anObject)[-1].retained) = 0;
|
||||
# ifdef OBJC_CAP_ARC
|
||||
objc_delete_weak_refs(anObject);
|
||||
# endif
|
||||
return YES;
|
||||
}
|
||||
#else /* GSATOMICREAD */
|
||||
|
@ -504,9 +502,7 @@ static BOOL objc_release_fast_no_destroy_internal(id anObject)
|
|||
pthread_mutex_lock(theLock);
|
||||
if (((obj)anObject)[-1].retained == 0)
|
||||
{
|
||||
# ifdef OBJC_CAP_ARC
|
||||
objc_delete_weak_refs(anObject);
|
||||
# endif
|
||||
pthread_mutex_unlock(theLock);
|
||||
return YES;
|
||||
}
|
||||
|
@ -947,6 +943,8 @@ static id gs_weak_load(id obj)
|
|||
{
|
||||
#ifdef OBJC_CAP_ARC
|
||||
_objc_weak_load = gs_weak_load;
|
||||
#else
|
||||
GSWeakInit();
|
||||
#endif
|
||||
objc_create_block_classes_as_subclasses_of(self);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue