---
title: usesWeakReadAndWriteBarriers
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nspointerfunctions/usesweakreadandwritebarriers
---

# usesWeakReadAndWriteBarriers

Specifies whether, in a garbage collected environment, pointers should use weak read and write barriers.

## Declaration

```swift
var usesWeakReadAndWriteBarriers: Bool { get set }
```

## Discussion

Discussion If you use garbage collection, read and write barrier functions must be used when pointers are from memory scanned by the collector.

## See Also

### Memory Configuration

- [acquireFunction](foundation/nspointerfunctions/acquirefunction.md)
- [relinquishFunction](foundation/nspointerfunctions/relinquishfunction.md)
- [usesStrongWriteBarrier](foundation/nspointerfunctions/usesstrongwritebarrier.md)
