   @inline(__always)
   public mutating func load(order: LoadMemoryOrder = .relaxed) -> COpaquePointer
   {
-    return COpaquePointer(ReadVoidPtr(&self.p, order.order))
+    return COpaquePointer(ReadVoidPtr(&ptr, order.order))
   }
 
   @inline(__always)
   public mutating func store(pointer: COpaquePointer, order: StoreMemoryOrder = .relaxed)
   {
-    StoreVoidPtr(UnsafePointer(pointer), &self.p, order.order)
+    StoreVoidPtr(UnsafePointer(pointer), &ptr, order.order)
   }
 
   @inline(__always)
   public mutating func swap(pointer: COpaquePointer, order: MemoryOrder = .relaxed) -> COpaquePointer
   {
-    return COpaquePointer(SwapVoidPtr(UnsafePointer(pointer), &self.p, order.order))
+    return COpaquePointer(SwapVoidPtr(UnsafePointer(pointer), &ptr, order.order))
   }
 
   @inline(__always)

    var expect = UnsafeMutablePointer<Void>(current)
    switch type {
    case .strong:
      return CASVoidPtr(&expect, UnsafePointer(future), &self.p, orderSuccess.order, orderFailure.order)
    case .weak:
      return CASWeakVoidPtr(&expect, UnsafePointer(future), &self.p, orderSuccess.order, orderFailure.order)
    }
  }
}

public struct AtomicPointer<Pointee>: NilLiteralConvertible
{
  private var p: UnsafeMutablePointer<Void>
  public init(_ ptr: UnsafePointer<Pointee> = nil) { self.p = UnsafeMutablePointer(ptr) }
  public init(nilLiteral: ()) { self.p = nil }

  public var pointer: UnsafePointer<Pointee> {
    mutating get { return UnsafePointer(ReadVoidPtr(&self.p, memory_order_relaxed)) }
    mutating set { StoreVoidPtr(newValue, &self.p, memory_order_relaxed) }
  }
}


    var expect = UnsafeMutablePointer<Void>(current)
    switch type {
    case .strong:
      return CASVoidPtr(&expect, UnsafePointer(future), &ptr, orderSuccess.order, orderFailure.order)
    case .weak:
      return CASWeakVoidPtr(&expect, UnsafePointer(future), &ptr, orderSuccess.order, orderFailure.order)
    }
  }
}

public struct AtomicOpaquePointer: NilLiteralConvertible
{
  private var ptr: UnsafeMutablePointer<Void>
  public init(_ ptr: COpaquePointer = nil) { self.ptr = UnsafeMutablePointer(ptr) }
  public init(nilLiteral: ()) { self.ptr = nil }

  public var pointer: COpaquePointer {
    mutating get { return COpaquePointer(ReadVoidPtr(&ptr, memory_order_relaxed)) }
    mutating set { StoreVoidPtr(UnsafePointer(newValue), &ptr, memory_order_relaxed) }
  }
}

