Skip to content

Commit 9accf4a

Browse files
authored
Merge pull request swiftlang#15686 from gottesmm/pr-2aa38499b4210d8c66240446893c4f340fc62351
[+0-all-args] Remove autoreleasepool on non-x86_64 platforms from Str…
2 parents d367dfc + bc48a66 commit 9accf4a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

stdlib/public/stubs/SwiftNativeNSXXXBaseARC.m

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,21 @@
3131
// decomposedStringWithCanonicalMapping implementation. Instead, we use a local
3232
// autorelease pool to prevent leaking of the temporary object into the callers
3333
// autorelease pool.
34-
#if defined(__i386__)
35-
#define AUTORELEASEPOOL @autoreleasepool
36-
#else
37-
// On other platforms we rely on the remove from autorelease pool optimization.
3834
//
39-
// PLUS ZERO TODO: Right now we force an autoreleasepool here where we really do
40-
// not want to do so. The reason why is that without the autoreleasepool (or
35+
//
36+
// FIXME: Right now we force an autoreleasepool here on x86_64 where we really
37+
// do not want to do so. The reason why is that without the autoreleasepool (or
4138
// really something like a defer), we tail call
4239
// objc_retainAutoreleasedReturnValue which blocks the hand shake. Evidently
4340
// this is something that we do not want to do. See:
4441
// b79ff50f1bca97ecfd053372f5f6dc9d017398bc. Until that is resolved, just create
45-
// an autoreleasepool here.
42+
// an autoreleasepool here on x86_64. On arm/arm64 we do not have such an issue
43+
// since we use an assembly marker instead.
44+
#if defined(__i386__) || defined(__x86_64__)
4645
#define AUTORELEASEPOOL @autoreleasepool
46+
#else
47+
// On other platforms we rely on the remove from autorelease pool optimization.
48+
#define AUTORELEASEPOOL
4749
#endif
4850

4951
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERFACE

0 commit comments

Comments
 (0)