@@ -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
@@ -332,6 +333,7 @@ HeapObject *swift::swift_allocEmptyBox() {
332
333
extern " C" SWIFT_LIBRARY_VISIBILITY SWIFT_NOINLINE SWIFT_USED void
333
334
_swift_release_dealloc (HeapObject *object);
334
335
336
+ SWIFT_ALWAYS_INLINE
335
337
static HeapObject *_swift_retain_ (HeapObject *object) {
336
338
SWIFT_RT_TRACK_INVOCATION (object, swift_retain);
337
339
if (isValidPointerForNativeRetain (object))
@@ -358,6 +360,7 @@ HeapObject *swift::swift_nonatomic_retain(HeapObject *object) {
358
360
return object;
359
361
}
360
362
363
+ SWIFT_ALWAYS_INLINE
361
364
static HeapObject *_swift_retain_n_ (HeapObject *object, uint32_t n) {
362
365
SWIFT_RT_TRACK_INVOCATION (object, swift_retain_n);
363
366
if (isValidPointerForNativeRetain (object))
@@ -384,6 +387,7 @@ HeapObject *swift::swift_nonatomic_retain_n(HeapObject *object, uint32_t n) {
384
387
return object;
385
388
}
386
389
390
+ SWIFT_ALWAYS_INLINE
387
391
static void _swift_release_ (HeapObject *object) {
388
392
SWIFT_RT_TRACK_INVOCATION (object, swift_release);
389
393
if (isValidPointerForNativeRetain (object))
@@ -408,6 +412,7 @@ void swift::swift_nonatomic_release(HeapObject *object) {
408
412
object->refCounts .decrementAndMaybeDeinitNonAtomic (1 );
409
413
}
410
414
415
+ SWIFT_ALWAYS_INLINE
411
416
static void _swift_release_n_ (HeapObject *object, uint32_t n) {
412
417
SWIFT_RT_TRACK_INVOCATION (object, swift_release_n);
413
418
if (isValidPointerForNativeRetain (object))
@@ -567,6 +572,7 @@ void swift::swift_nonatomic_unownedRelease_n(HeapObject *object, int n) {
567
572
}
568
573
}
569
574
575
+ SWIFT_ALWAYS_INLINE
570
576
static HeapObject *_swift_tryRetain_ (HeapObject *object) {
571
577
SWIFT_RT_TRACK_INVOCATION (object, swift_tryRetain);
572
578
if (!isValidPointerForNativeRetain (object))
0 commit comments