CamlinternalOO(3)

πŸ’… CamlinternalOO

okay so this is the OCaml library manual page for CamlinternalOO (section 3, bestie). It's the run-time support for objects and classes, and it's system use only territory β€” not for the casual user. No cap, it's internal runtime business. πŸ’–

πŸŽ€ NAME

CamlinternalOO β€” run-time support for objects and classes. ✨

🧸 Module

Module CamlinternalOO

πŸ“š Documentation

Here's the module shape the docs show:

Module CamlinternalOO
 : sig end
⚠️ Important vibe check: all functions in this module are for system use only, not for the casual user. It's giving "runtime support, do not casually touch" energy. 😭

πŸ’… Classes

Class-side types and functions, exactly as listed β€” no renaming, no merging, no skipped entries:

type tag
type label
type table
type meth
type t
type obj
type closure

val public_method_label : string -> tag
val new_method : table -> label
val new_variable : table -> string -> int
val new_methods_variables : table -> string array -> string array -> label array
val get_variable : table -> string -> int
val get_variables : table -> string array -> int array
val get_method_label : table -> string -> label
val get_method_labels : table -> string array -> label array
val get_method : table -> label -> meth
val set_method : table -> label -> meth -> unit
val set_methods : table -> label array -> unit
val narrow : table -> string array -> string array -> string array -> unit
val widen : table -> unit
val add_initializer : table -> (obj -> unit) -> unit
val dummy_table : table
val create_table : string array -> table
val init_class : table -> unit
val inherits : table -> string array -> string array -> string array -> t * (table -> obj -> Obj.t) * obj -> bool -> Obj.t array
val make_class : string array -> (table -> Obj.t -> t) -> t * (table -> Obj.t -> t) * Obj.t
type init_table
val make_class_store : string array -> (table -> t) -> init_table -> unit
val dummy_class : string * int * int -> t * (table -> Obj.t -> t) * Obj.t

πŸ¦‹ Objects

Object-side stuff, all here, all accounted for:

val copy : (< .. > as 'a) -> 'a
val create_object : table -> obj
val create_object_opt : obj -> table -> obj
val run_initializers : obj -> table -> unit
val run_initializers_opt : obj -> obj -> table -> obj
val create_object_and_run_initializers : obj -> table -> obj
val send : obj -> tag -> t
val sendcache : obj -> tag -> t -> int -> t
val sendself : obj -> label -> t
val get_public_method : obj -> tag -> closure

πŸ”₯ Table cache

The table-cache corner of the function list:

type tables
val lookup_tables : tables -> closure array -> tables

🧚 Builtins to reduce code size

The impl variant, with every constructor kept exactly where it belongs:

type impl =
 | GetConst
 | GetVar
 | GetEnv
 | GetMeth
 | SetVar
 | AppConst
 | AppVar
 | AppEnv
 | AppMeth
 | AppConstConst
 | AppConstVar
 | AppConstEnv
 | AppConstMeth
 | AppVarConst
 | AppEnvConst
 | AppMethConst
 | MethAppConst
 | MethAppVar
 | MethAppEnv
 | MethAppMeth
 | SendConst
 | SendVar
 | SendEnv
 | SendMeth
 | Closure of closure

πŸŽ€ Parameters

The mutable parameters record and its value:

type params = {
  mutable compact_table : bool ;
  mutable copy_parent : bool ;
  mutable clean_when_copying : bool ;
  mutable retry_count : int ;
  mutable bucket_small_size : int ;
}
val params : params

🌈 Statistics

The stats record and the function that hands it over:

type stats = {
  classes : int ;
  methods : int ;
  inst_vars : int ;
}
val stats : unit -> stats

mwah πŸ’– β€” OCamldoc, 2026-06-22, CamlinternalOO(3). bye bestie 🫢

πŸ“¦ where this page comes from