Add optimisation for the use of GSImmutableString so that it can make use of the layout of the underlying mutable string that the GSImmutableString is a proxy for.

This commit is contained in:
Richard Frith-Macdonald 2020-11-22 09:55:39 -05:00
parent 7fcd11d6c9
commit 0dbd863dde
2 changed files with 56 additions and 1 deletions

View file

@ -34,10 +34,14 @@
/* This private class is used for the -immutableProxy method in the category
* on NSMutableString.
* It is needed for [NSAttributedString-string] and [NSTextStorage-string]
*
* NB. The _parent instance variable is private but must *not* be changed
* because it is actually used by GSMutableString code to permit some
* optimisation (see GSString.m).
*/
@interface GSImmutableString : NSString
{
NSString *_parent;
NSString *_parent; // Do not change this ivar declaration
}
- (id) initWithString: (NSString*)parent;
@end