Skip to content

Instantly share code, notes, and snippets.

@haoyu-c
Last active May 19, 2020 12:41
Show Gist options
  • Save haoyu-c/9eede2c8585359202abf6770ff500dd9 to your computer and use it in GitHub Desktop.
Save haoyu-c/9eede2c8585359202abf6770ff500dd9 to your computer and use it in GitHub Desktop.
template <typename RefCountBits>
class RefCounts {
std::atomic<RefCountBits> refCounts;
void incrementSlow(RefCountBits oldbits, uint32_t inc) SWIFT_CC(PreserveMost);
void incrementNonAtomicSlow(RefCountBits oldbits, uint32_t inc);
bool tryIncrementSlow(RefCountBits oldbits);
bool tryIncrementNonAtomicSlow(RefCountBits oldbits);
void incrementUnownedSlow(uint32_t inc);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment