---
name: "Atomic.Loc"
section: "3o"
platform: "linux"
package: "ocaml"
version: "5.5.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Atomic.Loc"
---

# Atomic.Loc(3o)

Atomic "locations", such as record fields.

## NAME

Atomic.Loc - Atomic "locations", such as record fields.

## Module

Module   Atomic.Loc

## Documentation

Module **Loc**\
  :  **sig end**

Atomic "locations", such as record fields.

**Since** 5.4

*type* **'a** *t* =  **'a atomic\_loc**

This module exposes a dedicated type  **'a Atomic.Loc.t** for atomic locations (storing a value of type  **'a** ) inside objects that may not be atomic references. It is used in particular for atomic record fields: if a record  **r** has an atomic field  **f** of type  **foo** , then  **\[%atomic.loc r.f\]** has type  **foo Atomic.Loc.t** .

The API below mirrors the API to access  **Atomic.Loc.t** , see the documentation above for more information.

*val get* :  **'a t -\> 'a**

*val set* :  **'a t -\> 'a -\> unit**

*val exchange* :  **'a t -\> 'a -\> 'a**

*val compare\_and\_set* :  **'a t -\> 'a -\> 'a -\> bool**

*val fetch\_and\_add* :  **int t -\> int -\> int**

*val incr* :  **int t -\> unit**

*val decr* :  **int t -\> unit**
