@@ -60,6 +60,7 @@ using namespace swift;
60
60
61
61
// / Returns true if the pointer passed to a native retain or release is valid.
62
62
// / If false, the operation should immediately return.
63
+ SWIFT_ALWAYS_INLINE
63
64
static inline bool isValidPointerForNativeRetain (const void *p) {
64
65
#if defined(__x86_64__) || defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64) || defined(__s390x__) || (defined(__powerpc64__) && defined(__LITTLE_ENDIAN__))
65
66
// On these platforms, except s390x, the upper half of address space is reserved for the
@@ -330,6 +331,7 @@ HeapObject *swift::swift_allocEmptyBox() {
330
331
extern " C" SWIFT_LIBRARY_VISIBILITY SWIFT_NOINLINE SWIFT_USED void
331
332
_swift_release_dealloc (HeapObject *object);
332
333
334
+ SWIFT_ALWAYS_INLINE
333
335
static HeapObject *_swift_retain_ (HeapObject *object) {
334
336
SWIFT_RT_TRACK_INVOCATION (object, swift_retain);
335
337
if (isValidPointerForNativeRetain (object))
@@ -356,6 +358,7 @@ HeapObject *swift::swift_nonatomic_retain(HeapObject *object) {
356
358
return object;
357
359
}
358
360
361
+ SWIFT_ALWAYS_INLINE
359
362
static HeapObject *_swift_retain_n_ (HeapObject *object, uint32_t n) {
360
363
SWIFT_RT_TRACK_INVOCATION (object, swift_retain_n);
361
364
if (isValidPointerForNativeRetain (object))
@@ -382,6 +385,7 @@ HeapObject *swift::swift_nonatomic_retain_n(HeapObject *object, uint32_t n) {
382
385
return object;
383
386
}
384
387
388
+ SWIFT_ALWAYS_INLINE
385
389
static void _swift_release_ (HeapObject *object) {
386
390
SWIFT_RT_TRACK_INVOCATION (object, swift_release);
387
391
if (isValidPointerForNativeRetain (object))
@@ -406,6 +410,7 @@ void swift::swift_nonatomic_release(HeapObject *object) {
406
410
object->refCounts .decrementAndMaybeDeinitNonAtomic (1 );
407
411
}
408
412
413
+ SWIFT_ALWAYS_INLINE
409
414
static void _swift_release_n_ (HeapObject *object, uint32_t n) {
410
415
SWIFT_RT_TRACK_INVOCATION (object, swift_release_n);
411
416
if (isValidPointerForNativeRetain (object))
@@ -562,6 +567,7 @@ void swift::swift_nonatomic_unownedRelease_n(HeapObject *object, int n) {
562
567
}
563
568
}
564
569
570
+ SWIFT_ALWAYS_INLINE
565
571
static HeapObject *_swift_tryRetain_ (HeapObject *object) {
566
572
SWIFT_RT_TRACK_INVOCATION (object, swift_tryRetain);
567
573
if (!isValidPointerForNativeRetain (object))
0 commit comments