@@ -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
@@ -332,6 +333,7 @@ HeapObject *swift::swift_allocEmptyBox() {
332333extern " C" SWIFT_LIBRARY_VISIBILITY SWIFT_NOINLINE SWIFT_USED void
333334_swift_release_dealloc (HeapObject *object);
334335
336+ SWIFT_ALWAYS_INLINE
335337static HeapObject *_swift_retain_ (HeapObject *object) {
336338 SWIFT_RT_TRACK_INVOCATION (object, swift_retain);
337339 if (isValidPointerForNativeRetain (object))
@@ -358,6 +360,7 @@ HeapObject *swift::swift_nonatomic_retain(HeapObject *object) {
358360 return object;
359361}
360362
363+ SWIFT_ALWAYS_INLINE
361364static HeapObject *_swift_retain_n_ (HeapObject *object, uint32_t n) {
362365 SWIFT_RT_TRACK_INVOCATION (object, swift_retain_n);
363366 if (isValidPointerForNativeRetain (object))
@@ -384,6 +387,7 @@ HeapObject *swift::swift_nonatomic_retain_n(HeapObject *object, uint32_t n) {
384387 return object;
385388}
386389
390+ SWIFT_ALWAYS_INLINE
387391static void _swift_release_ (HeapObject *object) {
388392 SWIFT_RT_TRACK_INVOCATION (object, swift_release);
389393 if (isValidPointerForNativeRetain (object))
@@ -408,6 +412,7 @@ void swift::swift_nonatomic_release(HeapObject *object) {
408412 object->refCounts .decrementAndMaybeDeinitNonAtomic (1 );
409413}
410414
415+ SWIFT_ALWAYS_INLINE
411416static void _swift_release_n_ (HeapObject *object, uint32_t n) {
412417 SWIFT_RT_TRACK_INVOCATION (object, swift_release_n);
413418 if (isValidPointerForNativeRetain (object))
@@ -567,6 +572,7 @@ void swift::swift_nonatomic_unownedRelease_n(HeapObject *object, int n) {
567572 }
568573}
569574
575+ SWIFT_ALWAYS_INLINE
570576static HeapObject *_swift_tryRetain_ (HeapObject *object) {
571577 SWIFT_RT_TRACK_INVOCATION (object, swift_tryRetain);
572578 if (!isValidPointerForNativeRetain (object))
0 commit comments