         return result
     }
     
-    @_transparent
-    private mutating func _compareSetWeak(old: AtomicBase<Instance>, new: AtomicBase<Instance>) -> Bool {
+    @inline(never)
+    private mutating func _compareSetWeak(old: Base, new: Base) -> Bool {
         let _old = Unmanaged.passUnretained(old)
         let _new = Unmanaged.passRetained(new)
-        let result = withUnsafeMutablePointer(to: &base) { $0.withMemoryRebound(to: Optional<UnsafeMutableRawPointer>.self, capacity: 1) { _AtomicCompareAndSwapWeakPtrBarrier(_old.toOpaque(), _new.toOpaque(), $0) } }
+        let result = withBasePointer { _AtomicCompareAndSwapWeakPtrBarrier(_old.toOpaque(), _new.toOpaque(), $0) }
         if result {
             _old.release()
         } else {

    
    /// Compare and set the value.
    public mutating func compareSet(old: Instance, new: Instance) -> Bool {
        while true {
            let (current, currentVal) = self.fetchSelf()
            if currentVal != old {
                return false
            }
            if compareSet(old: current, new: new) {
                return true
            }
        }

    
    /// Atomic fetch the current value.
    public mutating func fetchSelf() -> (current: Atomic, value: Instance) {
        let _base = self._fetch()
        return (Atomic(base: _base), _base.value)
    }
    
    /// Compare and set the value.
    public mutating func compareSet(old: Atomic, new: Instance) -> Bool {
        return self._compareSet(old: old.base, new: Base(value: new))
    }
    
    /// Set the value, and returns the previous value.
    public mutating func fetchStore(_ new: Instance) -> Instance {
        return self._fetchStore(Base(value: new)).value
    }
    
    /// Set the value.
    @discardableResult
    public mutating func fetchStore(block: (Instance) throws -> Instance) rethrows -> Instance {
        let new = Base(value: base.value)
        while true {
            let _base = self._fetch()
            new.value = try block(_base.value)
            if self._compareSetWeak(old: _base, new: new) {
                return _base.value
            }
        }
    }
