View difference between Paste ID: L8XguyKJ and 2h94JkqN
SHOW: | | - or go back to the newest paste.
1-
- (NSUInteger)retainCount
1+
- (id)retain
2
{
3-
    return NSExtraRefCount(self) + 1;
3+
    NSIncrementExtraRefCount(self);
4
    return self;
5
}
6-
inline NSUInteger
6+
7-
NSExtraRefCount(id anObject)
7+
inline void
8
NSIncrementExtraRefCount(id anObject)
9-
    return (struct obj_layout *)anObject)[-1].retained;
9+
10
    if(((struct obj_layout *)anObject[-1].retained == UINT_MAX - 1)
11
        [NSException raise: NSInternalInconsistancyException
12
                    format: @"NSIncrementExtraRefCount() asked to increment too far"];
13
14
    ((struct obj_layout *)anObject)[-1].retained++;
15
}