File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 22
22
// The following two routines need to be implemented in ARC because
23
23
// decomposedStringWithCanonicalMapping returns its result autoreleased. And we
24
24
// want ARC to insert 'objc_retainAutoreleasedReturnValue' and the necessary
25
- // markers for the hand-off.
25
+ // markers for the hand-off to facilitate the remove from autorelease pool
26
+ // optimization such that the object is not handed into the current autorelease
27
+ // pool which might be scoped such that repeatedly placing objects into it
28
+ // results in unbounded memory growth.
26
29
27
- // On i386 we use an autorelease pool to prevent leaking.
30
+ // On i386 the remove from autorelease pool optimization is foiled by the
31
+ // decomposedStringWithCanonicalMapping implementation. Instead, we use a local
32
+ // autorelease pool to prevent leaking of the temporary object into the callers
33
+ // autorelease pool.
28
34
#if defined(__i386__)
29
35
#define AUTORELEASEPOOL @autoreleasepool
30
36
#else
31
- // On other platforms we rely on autorelease return optimization.
37
+ // On other platforms we rely on the remove from autorelease pool optimization.
32
38
#define AUTORELEASEPOOL
33
39
#endif
34
40
You can’t perform that action at this time.
0 commit comments