Skip to content

Commit aeb71c4

Browse files
nickolas-pohiletsktoso
authored andcommitted
Disable retain count checks in actor deinit for embedded runtime
1 parent b7b83d2 commit aeb71c4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

stdlib/public/Concurrency/Actor.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,6 +1665,10 @@ void ProcessOutOfLineJob::process(Job *job) {
16651665
#endif /* !SWIFT_CONCURRENCY_ACTORS_AS_LOCKS */
16661666

16671667
void DefaultActorImpl::destroy() {
1668+
#if SWIFT_CONCURRENCY_EMBEDDED
1669+
// Embedded runtime does not track the refcount inside deinit
1670+
// See swift_release_n_(object:,n:) in EmbeddedRuntime.swift
1671+
#else
16681672
HeapObject *object = asAbstract(this);
16691673
size_t retainCount = swift_retainCount(object);
16701674
if (SWIFT_UNLIKELY(retainCount > 1)) {
@@ -1680,6 +1684,7 @@ void DefaultActorImpl::destroy() {
16801684
descriptor ? descriptor->Name.get() : "<unknown>",
16811685
retainCount);
16821686
}
1687+
#endif
16831688

16841689
#if SWIFT_CONCURRENCY_ACTORS_AS_LOCKS
16851690
// TODO (rokhinip): Do something to assert that the lock is unowned

0 commit comments

Comments
 (0)