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

# Stdlib.Obj(3o)

no description

## NAME

Stdlib.Obj - no description

## Module

Module   Stdlib.Obj

## Documentation

Module **Obj**\
  :  **(module Stdlib\_\_Obj)**

*type t*

*type raw\_data* =  **nativeint**

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

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

*val magic* :  **'a -\> 'b**

*val is\_block* :  **t -\> bool**

*val is\_int* :  **t -\> bool**

*val tag* :  **t -\> int**

*val size* :  **t -\> int**

*val reachable\_words* :  **t -\> int**

Computes the total size (in words, including the headers) of all heap blocks accessible from the argument.  Statically allocated blocks are included.

**Since** 4.04

*val field* :  **t -\> int -\> t**

*val set\_field* :  **t -\> int -\> t -\> unit**

When using flambda:

**set\_field** MUST NOT be called on immutable blocks.  (Blocks allocated in C stubs, or with  **new\_block** below, are always considered mutable.)

The same goes for  **set\_double\_field** .

For experts only: **set\_field** et al can be made safe by first wrapping the block in **Sys.opaque\_identity** , so any information about its contents will not be propagated.

*val double\_field* :  **t -\> int -\> float**

*val set\_double\_field* :  **t -\> int -\> float -\> unit**

*val raw\_field* :  **t -\> int -\> raw\_data**

*val set\_raw\_field* :  **t -\> int -\> raw\_data -\> unit**

*val new\_block* :  **int -\> int -\> t**

*val dup* :  **t -\> t**

*val add\_offset* :  **t -\> Int32.t -\> t**

*val with\_tag* :  **int -\> t -\> t**

*val first\_non\_constant\_constructor\_tag* :  **int**

*val last\_non\_constant\_constructor\_tag* :  **int**

*val forcing\_tag* :  **int**

*val cont\_tag* :  **int**

*val lazy\_tag* :  **int**

*val closure\_tag* :  **int**

*val object\_tag* :  **int**

*val infix\_tag* :  **int**

*val forward\_tag* :  **int**

*val no\_scan\_tag* :  **int**

*val abstract\_tag* :  **int**

*val string\_tag* :  **int**

*val double\_tag* :  **int**

*val double\_array\_tag* :  **int**

*val custom\_tag* :  **int**

*val int\_tag* :  **int**

*val out\_of\_heap\_tag* :  **int**

*val unaligned\_tag* :  **int**

*module Extension\_constructor :* **sig end**

*module Ephemeron :* **sig end**
