@@ -60,6 +60,7 @@ using namespace swift;
6060
6161// / Returns true if the pointer passed to a native retain or release is valid.
6262// / If false, the operation should immediately return.
63+ SWIFT_ALWAYS_INLINE
6364static inline bool isValidPointerForNativeRetain (const void *p) {
6465#if defined(__x86_64__) || defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64) || defined(__s390x__) || (defined(__powerpc64__) && defined(__LITTLE_ENDIAN__))
6566 // On these platforms, except s390x, the upper half of address space is reserved for the
@@ -330,6 +331,7 @@ HeapObject *swift::swift_allocEmptyBox() {
330331extern " C" SWIFT_LIBRARY_VISIBILITY SWIFT_NOINLINE SWIFT_USED void
331332_swift_release_dealloc (HeapObject *object);
332333
334+ SWIFT_ALWAYS_INLINE
333335static HeapObject *_swift_retain_ (HeapObject *object) {
334336 SWIFT_RT_TRACK_INVOCATION (object, swift_retain);
335337 if (isValidPointerForNativeRetain (object))
@@ -356,6 +358,7 @@ HeapObject *swift::swift_nonatomic_retain(HeapObject *object) {
356358 return object;
357359}
358360
361+ SWIFT_ALWAYS_INLINE
359362static HeapObject *_swift_retain_n_ (HeapObject *object, uint32_t n) {
360363 SWIFT_RT_TRACK_INVOCATION (object, swift_retain_n);
361364 if (isValidPointerForNativeRetain (object))
@@ -382,6 +385,7 @@ HeapObject *swift::swift_nonatomic_retain_n(HeapObject *object, uint32_t n) {
382385 return object;
383386}
384387
388+ SWIFT_ALWAYS_INLINE
385389static void _swift_release_ (HeapObject *object) {
386390 SWIFT_RT_TRACK_INVOCATION (object, swift_release);
387391 if (isValidPointerForNativeRetain (object))
@@ -406,6 +410,7 @@ void swift::swift_nonatomic_release(HeapObject *object) {
406410 object->refCounts .decrementAndMaybeDeinitNonAtomic (1 );
407411}
408412
413+ SWIFT_ALWAYS_INLINE
409414static void _swift_release_n_ (HeapObject *object, uint32_t n) {
410415 SWIFT_RT_TRACK_INVOCATION (object, swift_release_n);
411416 if (isValidPointerForNativeRetain (object))
@@ -562,6 +567,7 @@ void swift::swift_nonatomic_unownedRelease_n(HeapObject *object, int n) {
562567 }
563568}
564569
570+ SWIFT_ALWAYS_INLINE
565571static HeapObject *_swift_tryRetain_ (HeapObject *object) {
566572 SWIFT_RT_TRACK_INVOCATION (object, swift_tryRetain);
567573 if (!isValidPointerForNativeRetain (object))
0 commit comments