All Releases

OCaml 4.11.2

This page describes OCaml 4.11.2, released on Feb 24, 2021. This is a bug-fix release of OCaml 4.11.0.

This release is available as an opam package.

Opam switches

This release is available as multiple opam switches:

  • 4.11.2 — Official release 4.11.2
  • 4.11.2+flambda — Official release 4.11.2, with flambda activated
  • 4.11.2+afl — Official release 4.11.2, with afl-fuzz instrumentation
  • 4.11.2+no-flat-float-array - Official release 4.11.2, with --disable-flat-float-array
  • 4.11.2+flambda+no-flat-float-array — Official release 4.11.2, with flambda activated and --disable-flat-float-array
  • 4.11.2+fp — Official release 4.11.2, with frame-pointers
  • 4.11.2+fp+flambda — Official release 4.11.2, with frame-pointers and flambda activated
  • 4.11.2+musl+static+flambda - Official release 4.11.2, compiled with musl-gcc -static and with flambda activated
  • 4.11.2+32bit - Official release 4.11.2, compiled in 32-bit mode for 64-bit Linux and OS X hosts
  • 4.11.2+bytecode-only - Official release 4.11.2, without the native-code compiler
  • 4.11.2+spacetime - Official 4.11.2 release with spacetime activated
  • 4.11.2+default-unsafe-string — Official release 4.11.2, without safe strings by default

Source distribution

  • Source tarball (.tar.gz) for compilation under Unix (including Linux and macOS) and Microsoft Windows (including Cygwin).
  • Also available in .zip format.
  • The official development repo is hosted on GitHub.


Build system:

  • 9938, 9939: Define __USE_MINGW_ANSI_STDIO=0 for the mingw-w64 ports to prevent their C99-compliant snprintf conflicting with ours. (David Allsopp, report by Michael Soegtrop, review by Xavier Leroy)

Runtime system:

  • 10056: Memprof: ensure young_trigger is within the bounds of the minor heap in caml_memprof_renew_minor_sample (regression from 8684) (David Allsopp, review by Guillaume Munch-Maccagnoni and Jacques-Henri Jourdan)

  • 9654: More efficient management of code fragments. (Xavier Leroy, review by Jacques-Henri Jourdan, Damien Doligez, and Stephen Dolan)


  • 9606, 9635, 9637: fix performance regression in the debugger (behaviors quadratic in the size of the debugged program) (Xavier Leroy, report by Jacques Garrigue and Virgile Prevosto, review by David Allsopp and Jacques-Henri Jourdan)

Code generation and optimizations:

  • 9969, 9981: Added mergeable flag to ELF sections containing mergeable constants. Fixes compatibility with the integrated assembler in clang 11.0.0. (Jacob Young, review by Nicolás Ojeda Bär)

Bug fixes:

  • 9970, 10010: fix the declaration scope of extensible-datatype constructors. A regression that dates back to 4.08 makes extensible-datatype constructors with inline records very fragile, for example: type 'a t += X of {x : 'a} (Gabriel Scherer, review by Thomas Refis and Leo White, report by Nicolás Ojeda Bär)

  • 9096, 10096: fix a 4.11.0 performance regression in classes/objects declared within a function (Gabriel Scherer, review by Leo White, report by Sacha Ayoun)

  • 9326, 10125: Gc.set incorrectly handles the three custom_* fields, causing a performance regression (report by Emilio Jesús Gallego Arias, analysis and fix by Stephen Dolan, code by Xavier Leroy, review by Hugo Heuzard and Gabriel Scherer)