diff --git a/dev/moonpool/Moonpool/Fifo_pool/For_runner_implementors/index.html b/dev/moonpool/Moonpool/Fifo_pool/For_runner_implementors/index.html index c677347f..9492ce29 100644 --- a/dev/moonpool/Moonpool/Fifo_pool/For_runner_implementors/index.html +++ b/dev/moonpool/Moonpool/Fifo_pool/For_runner_implementors/index.html @@ -5,4 +5,4 @@ shutdown:(wait:bool -> unit -> unit) -> run_async:(task -> unit) -> unit -> - t

Create a new runner.

NOTE: the runner should support DLA and Suspend_ on OCaml 5.x, so that Fork_join and other 5.x features work properly.

val k_cur_runner : t option ref Moonpool__.Thread_local_storage_.key
+ t

Create a new runner.

NOTE: the runner should support DLA and Suspend_ on OCaml 5.x, so that Fork_join and other 5.x features work properly.

val k_cur_runner : t option Stdlib.ref Moonpool__.Thread_local_storage_.key
diff --git a/dev/moonpool/Moonpool/Fifo_pool/index.html b/dev/moonpool/Moonpool/Fifo_pool/index.html index 5807c2a0..60d78536 100644 --- a/dev/moonpool/Moonpool/Fifo_pool/index.html +++ b/dev/moonpool/Moonpool/Fifo_pool/index.html @@ -1,5 +1,5 @@ -Fifo_pool (moonpool.Moonpool.Fifo_pool)

Module Moonpool.Fifo_pool

A simple thread pool in FIFO order.

FIFO: first-in, first-out. Basically tasks are put into a queue, and worker threads pull them out of the queue at the other end.

Since this uses a single blocking queue to manage tasks, it's very simple and reliable. The number of worker threads is fixed, but they are spread over several domains to enable parallelism.

This can be useful for latency-sensitive applications (e.g. as a pool of workers for network servers). Work-stealing pools might have higher throughput but they're very unfair to some tasks; by contrast, here, older tasks have priority over younger tasks.

include module type of Runner
type task = unit -> unit
type t

A runner.

If a runner is no longer needed, shutdown can be used to signal all worker threads in it to stop (after they finish their work), and wait for them to stop.

The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simple the single runtime on OCaml 4).

val size : t -> int

Number of threads/workers.

val num_tasks : t -> int

Current number of tasks. This is at best a snapshot, useful for metrics and debugging.

val shutdown : t -> unit

Shutdown the runner and wait for it to terminate. Idempotent.

val shutdown_without_waiting : t -> unit

Shutdown the pool, and do not wait for it to terminate. Idempotent.

exception Shutdown
val run_async : t -> task -> unit

run_async pool f schedules f for later execution on the runner in one of the threads. f() will run on one of the runner's worker threads/domains.

  • raises Shutdown

    if the runner was shut down before run_async was called.

val run_wait_block : t -> (unit -> 'a) -> 'a

run_wait_block pool f schedules f for later execution on the pool, like run_async. It then blocks the current thread until f() is done executing, and returns its result. If f() raises an exception, then run_wait_block pool f will raise it as well.

NOTE be careful with deadlocks (see notes in Fut.wait_block about the required discipline to avoid deadlocks).

module For_runner_implementors : sig ... end

This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

val get_current_runner : unit -> t option

Access the current runner. This returns Some r if the call happens on a thread that belongs in a runner.

  • since NEXT_RELEASE
type ('a, 'b) create_args = +Fifo_pool (moonpool.Moonpool.Fifo_pool)

Module Moonpool.Fifo_pool

A simple thread pool in FIFO order.

FIFO: first-in, first-out. Basically tasks are put into a queue, and worker threads pull them out of the queue at the other end.

Since this uses a single blocking queue to manage tasks, it's very simple and reliable. The number of worker threads is fixed, but they are spread over several domains to enable parallelism.

This can be useful for latency-sensitive applications (e.g. as a pool of workers for network servers). Work-stealing pools might have higher throughput but they're very unfair to some tasks; by contrast, here, older tasks have priority over younger tasks.

  • since 0.5
include module type of Runner
type task = unit -> unit
type t

A runner.

If a runner is no longer needed, shutdown can be used to signal all worker threads in it to stop (after they finish their work), and wait for them to stop.

The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simple the single runtime on OCaml 4).

val size : t -> int

Number of threads/workers.

val num_tasks : t -> int

Current number of tasks. This is at best a snapshot, useful for metrics and debugging.

val shutdown : t -> unit

Shutdown the runner and wait for it to terminate. Idempotent.

val shutdown_without_waiting : t -> unit

Shutdown the pool, and do not wait for it to terminate. Idempotent.

exception Shutdown
val run_async : t -> task -> unit

run_async pool f schedules f for later execution on the runner in one of the threads. f() will run on one of the runner's worker threads/domains.

  • raises Shutdown

    if the runner was shut down before run_async was called.

val run_wait_block : t -> (unit -> 'a) -> 'a

run_wait_block pool f schedules f for later execution on the pool, like run_async. It then blocks the current thread until f() is done executing, and returns its result. If f() raises an exception, then run_wait_block pool f will raise it as well.

NOTE be careful with deadlocks (see notes in Fut.wait_block about the required discipline to avoid deadlocks).

module For_runner_implementors : sig ... end

This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

val get_current_runner : unit -> t option

Access the current runner. This returns Some r if the call happens on a thread that belongs in a runner.

  • since 0.5
type ('a, 'b) create_args = ?on_init_thread:(dom_id:int -> t_id:int -> unit -> unit) -> ?on_exit_thread:(dom_id:int -> t_id:int -> unit -> unit) -> ?on_exn:(exn -> Stdlib.Printexc.raw_backtrace -> unit) -> diff --git a/dev/moonpool/Moonpool/Fut/Infix/index.html b/dev/moonpool/Moonpool/Fut/Infix/index.html index 737440a4..a48db867 100644 --- a/dev/moonpool/Moonpool/Fut/Infix/index.html +++ b/dev/moonpool/Moonpool/Fut/Infix/index.html @@ -1,2 +1,2 @@ -Infix (moonpool.Moonpool.Fut.Infix)

Module Fut.Infix

  • since NEXT_RELEASE
val (>|=) : 'a t -> ('a -> 'b) -> 'b t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val let+ : 'a t -> ('a -> 'b) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val let* : 'a t -> ('a -> 'b t) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
+Infix (moonpool.Moonpool.Fut.Infix)

Module Fut.Infix

  • since 0.5
val (>|=) : 'a t -> ('a -> 'b) -> 'b t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val let+ : 'a t -> ('a -> 'b) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val let* : 'a t -> ('a -> 'b t) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
diff --git a/dev/moonpool/Moonpool/Fut/index.html b/dev/moonpool/Moonpool/Fut/index.html index 58440db7..7d893a51 100644 --- a/dev/moonpool/Moonpool/Fut/index.html +++ b/dev/moonpool/Moonpool/Fut/index.html @@ -1,2 +1,2 @@ -Fut (moonpool.Moonpool.Fut)

Module Moonpool.Fut

Futures.

A future of type 'a t represents the result of a computation that will yield a value of type 'a.

Typically, the computation is running on a thread pool Runner.t and will proceed on some worker. Once set, a future cannot change. It either succeeds (storing a Ok x with x: 'a), or fail (storing a Error (exn, bt) with an exception and the corresponding backtrace).

Combinators such as map and join_array can be used to produce futures from other futures (in a monadic way). Some combinators take a on argument to specify a runner on which the intermediate computation takes place; for example map ~on:pool ~f fut maps the value in fut using function f, applicatively; the call to f happens on the runner pool (once fut resolves successfully with a value).

type 'a or_error = ('a, exn * Stdlib.Printexc.raw_backtrace) result
type 'a t

A future with a result of type 'a.

type 'a promise

A promise, which can be fulfilled exactly once to set the corresponding future

val make : unit -> 'a t * 'a promise

Make a new future with the associated promise

val on_result : 'a t -> ('a or_error -> unit) -> unit

on_result fut f registers f to be called in the future when fut is set ; or calls f immediately if fut is already set.

exception Already_fulfilled
val fulfill : 'a promise -> 'a or_error -> unit

Fullfill the promise, setting the future at the same time.

val fulfill_idempotent : 'a promise -> 'a or_error -> unit

Fullfill the promise, setting the future at the same time. Does nothing if the promise is already fulfilled.

val return : 'a -> 'a t

Already settled future, with a result

val fail : exn -> Stdlib.Printexc.raw_backtrace -> _ t

Already settled future, with a failure

val of_result : 'a or_error -> 'a t
val is_resolved : _ t -> bool

is_resolved fut is true iff fut is resolved.

val peek : 'a t -> 'a or_error option

peek fut returns Some r if fut is currently resolved with r, and None if fut is not resolved yet.

exception Not_ready
  • since 0.2
val get_or_fail : 'a t -> 'a or_error

get_or_fail fut obtains the result from fut if it's fulfilled (i.e. if peek fut returns Some res, get_or_fail fut returns res).

  • since 0.2
val get_or_fail_exn : 'a t -> 'a

get_or_fail_exn fut obtains the result from fut if it's fulfilled, like get_or_fail. If the result is an Error _, the exception inside is re-raised.

  • since 0.2
val is_done : _ t -> bool

Is the future resolved? This is the same as peek fut |> Option.is_some.

  • since 0.2

Combinators

val spawn : on:Runner.t -> (unit -> 'a) -> 'a t

spaw ~on f runs f() on the given runner on, and return a future that will hold its result.

val spawn_on_current_runner : (unit -> 'a) -> 'a t

This must be run from inside a runner, and schedules the new task on it as well.

See Runner.get_current_runner to see how the runner is found.

  • since NEXT_RELEASE
  • raises Failure

    if run from outside a runner.

val reify_error : 'a t -> 'a or_error t

reify_error fut turns a failing future into a non-failing one that contain Error (exn, bt). A non-failing future returning x is turned into Ok x

  • since 0.4
val map : ?on:Runner.t -> f:('a -> 'b) -> 'a t -> 'b t

map ?on ~f fut returns a new future fut2 that resolves with f x if fut resolved with x; and fails with e if fut fails with e or f x raises e.

  • parameter on

    if provided, f runs on the given runner

val bind : ?on:Runner.t -> f:('a -> 'b t) -> 'a t -> 'b t

bind ?on ~f fut returns a new future fut2 that resolves like the future f x if fut resolved with x; and fails with e if fut fails with e or f x raises e.

  • parameter on

    if provided, f runs on the given runner

val bind_reify_error : ?on:Runner.t -> f:('a or_error -> 'b t) -> 'a t -> 'b t

bind_reify_error ?on ~f fut returns a new future fut2 that resolves like the future f (Ok x) if fut resolved with x; and resolves like the future f (Error (exn, bt)) if fut fails with exn and backtrace bt.

  • parameter on

    if provided, f runs on the given runner

  • since 0.4
val join : 'a t t -> 'a t

join fut is fut >>= Fun.id. It joins the inner layer of the future.

  • since 0.2
val both : 'a t -> 'b t -> ('a * 'b) t

both a b succeeds with x, y if a succeeds with x and b succeeds with y, or fails if any of them fails.

val choose : 'a t -> 'b t -> ('a, 'b) Either.t t

choose a b succeeds Left x or Right y if a succeeds with x or b succeeds with y, or fails if both of them fails. If they both succeed, it is not specified which result is used.

val choose_same : 'a t -> 'a t -> 'a t

choose_same a b succeeds with the value of one of a or b if they succeed, or fails if both fail. If they both succeed, it is not specified which result is used.

val join_array : 'a t array -> 'a array t

Wait for all the futures in the array. Fails if any future fails.

val join_list : 'a t list -> 'a list t

Wait for all the futures in the list. Fails if any future fails.

val wait_array : _ t array -> unit t

wait_array arr waits for all futures in arr to resolve. It discards the individual results of futures in arr. It fails if any future fails.

val wait_list : _ t list -> unit t

wait_list l waits for all futures in l to resolve. It discards the individual results of futures in l. It fails if any future fails.

val for_ : on:Runner.t -> int -> (int -> unit) -> unit t

for_ ~on n f runs f 0, f 1, …, f (n-1) on the runner, and returns a future that resolves when all the tasks have resolved, or fails as soon as one task has failed.

val for_array : on:Runner.t -> 'a array -> (int -> 'a -> unit) -> unit t

for_array ~on arr f runs f 0 arr.(0), …, f (n-1) arr.(n-1) in the runner (where n = Array.length arr), and returns a future that resolves when all the tasks are done, or fails if any of them fails.

  • since 0.2
val for_list : on:Runner.t -> 'a list -> ('a -> unit) -> unit t

for_list ~on l f is like for_array ~on (Array.of_list l) f.

  • since 0.2

Await

NOTE This is only available on OCaml 5.

val await : 'a t -> 'a

await fut suspends the current tasks until fut is fulfilled, then resumes the task on this same runner.

  • since 0.3

This must only be run from inside the runner itself. The runner must support Suspend_. NOTE: only on OCaml 5.x

Blocking

val wait_block : 'a t -> 'a or_error

wait_block fut blocks the current thread until fut is resolved, and returns its value.

NOTE: A word of warning: this will monopolize the calling thread until the future resolves. This can also easily cause deadlocks, if enough threads in a pool call wait_block on futures running on the same pool or a pool depending on it.

A good rule to avoid deadlocks is to run this from outside of any pool, or to have an acyclic order between pools where wait_block is only called from a pool on futures evaluated in a pool that comes lower in the hierarchy. If this rule is broken, it is possible for all threads in a pool to wait for futures that can only make progress on these same threads, hence the deadlock.

val wait_block_exn : 'a t -> 'a

Same as wait_block but re-raises the exception if the future failed.

Infix operators

These combinators run on either the current pool (if present), or on the same thread that just fulfilled the previous future if not.

They were previously present as module Infix_local and val infix, but are now simplified.

  • since NEXT_RELEASE
module Infix : sig ... end
include module type of Infix
  • since NEXT_RELEASE
val (>|=) : 'a t -> ('a -> 'b) -> 'b t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val let+ : 'a t -> ('a -> 'b) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val let* : 'a t -> ('a -> 'b t) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
module Infix_local = Infix
+Fut (moonpool.Moonpool.Fut)

Module Moonpool.Fut

Futures.

A future of type 'a t represents the result of a computation that will yield a value of type 'a.

Typically, the computation is running on a thread pool Runner.t and will proceed on some worker. Once set, a future cannot change. It either succeeds (storing a Ok x with x: 'a), or fail (storing a Error (exn, bt) with an exception and the corresponding backtrace).

Combinators such as map and join_array can be used to produce futures from other futures (in a monadic way). Some combinators take a on argument to specify a runner on which the intermediate computation takes place; for example map ~on:pool ~f fut maps the value in fut using function f, applicatively; the call to f happens on the runner pool (once fut resolves successfully with a value).

type 'a or_error = ('a, exn * Stdlib.Printexc.raw_backtrace) result
type 'a t

A future with a result of type 'a.

type 'a promise

A promise, which can be fulfilled exactly once to set the corresponding future

val make : unit -> 'a t * 'a promise

Make a new future with the associated promise

val on_result : 'a t -> ('a or_error -> unit) -> unit

on_result fut f registers f to be called in the future when fut is set ; or calls f immediately if fut is already set.

exception Already_fulfilled
val fulfill : 'a promise -> 'a or_error -> unit

Fullfill the promise, setting the future at the same time.

val fulfill_idempotent : 'a promise -> 'a or_error -> unit

Fullfill the promise, setting the future at the same time. Does nothing if the promise is already fulfilled.

val return : 'a -> 'a t

Already settled future, with a result

val fail : exn -> Stdlib.Printexc.raw_backtrace -> _ t

Already settled future, with a failure

val of_result : 'a or_error -> 'a t
val is_resolved : _ t -> bool

is_resolved fut is true iff fut is resolved.

val peek : 'a t -> 'a or_error option

peek fut returns Some r if fut is currently resolved with r, and None if fut is not resolved yet.

exception Not_ready
  • since 0.2
val get_or_fail : 'a t -> 'a or_error

get_or_fail fut obtains the result from fut if it's fulfilled (i.e. if peek fut returns Some res, get_or_fail fut returns res).

  • since 0.2
val get_or_fail_exn : 'a t -> 'a

get_or_fail_exn fut obtains the result from fut if it's fulfilled, like get_or_fail. If the result is an Error _, the exception inside is re-raised.

  • since 0.2
val is_done : _ t -> bool

Is the future resolved? This is the same as peek fut |> Option.is_some.

  • since 0.2

Combinators

val spawn : on:Runner.t -> (unit -> 'a) -> 'a t

spaw ~on f runs f() on the given runner on, and return a future that will hold its result.

val spawn_on_current_runner : (unit -> 'a) -> 'a t

This must be run from inside a runner, and schedules the new task on it as well.

See Runner.get_current_runner to see how the runner is found.

  • since 0.5
  • raises Failure

    if run from outside a runner.

val reify_error : 'a t -> 'a or_error t

reify_error fut turns a failing future into a non-failing one that contain Error (exn, bt). A non-failing future returning x is turned into Ok x

  • since 0.4
val map : ?on:Runner.t -> f:('a -> 'b) -> 'a t -> 'b t

map ?on ~f fut returns a new future fut2 that resolves with f x if fut resolved with x; and fails with e if fut fails with e or f x raises e.

  • parameter on

    if provided, f runs on the given runner

val bind : ?on:Runner.t -> f:('a -> 'b t) -> 'a t -> 'b t

bind ?on ~f fut returns a new future fut2 that resolves like the future f x if fut resolved with x; and fails with e if fut fails with e or f x raises e.

  • parameter on

    if provided, f runs on the given runner

val bind_reify_error : ?on:Runner.t -> f:('a or_error -> 'b t) -> 'a t -> 'b t

bind_reify_error ?on ~f fut returns a new future fut2 that resolves like the future f (Ok x) if fut resolved with x; and resolves like the future f (Error (exn, bt)) if fut fails with exn and backtrace bt.

  • parameter on

    if provided, f runs on the given runner

  • since 0.4
val join : 'a t t -> 'a t

join fut is fut >>= Fun.id. It joins the inner layer of the future.

  • since 0.2
val both : 'a t -> 'b t -> ('a * 'b) t

both a b succeeds with x, y if a succeeds with x and b succeeds with y, or fails if any of them fails.

val choose : 'a t -> 'b t -> ('a, 'b) Either.t t

choose a b succeeds Left x or Right y if a succeeds with x or b succeeds with y, or fails if both of them fails. If they both succeed, it is not specified which result is used.

val choose_same : 'a t -> 'a t -> 'a t

choose_same a b succeeds with the value of one of a or b if they succeed, or fails if both fail. If they both succeed, it is not specified which result is used.

val join_array : 'a t array -> 'a array t

Wait for all the futures in the array. Fails if any future fails.

val join_list : 'a t list -> 'a list t

Wait for all the futures in the list. Fails if any future fails.

val wait_array : _ t array -> unit t

wait_array arr waits for all futures in arr to resolve. It discards the individual results of futures in arr. It fails if any future fails.

val wait_list : _ t list -> unit t

wait_list l waits for all futures in l to resolve. It discards the individual results of futures in l. It fails if any future fails.

val for_ : on:Runner.t -> int -> (int -> unit) -> unit t

for_ ~on n f runs f 0, f 1, …, f (n-1) on the runner, and returns a future that resolves when all the tasks have resolved, or fails as soon as one task has failed.

val for_array : on:Runner.t -> 'a array -> (int -> 'a -> unit) -> unit t

for_array ~on arr f runs f 0 arr.(0), …, f (n-1) arr.(n-1) in the runner (where n = Array.length arr), and returns a future that resolves when all the tasks are done, or fails if any of them fails.

  • since 0.2
val for_list : on:Runner.t -> 'a list -> ('a -> unit) -> unit t

for_list ~on l f is like for_array ~on (Array.of_list l) f.

  • since 0.2

Await

NOTE This is only available on OCaml 5.

val await : 'a t -> 'a

await fut suspends the current tasks until fut is fulfilled, then resumes the task on this same runner.

  • since 0.3

This must only be run from inside the runner itself. The runner must support Suspend_. NOTE: only on OCaml 5.x

Blocking

val wait_block : 'a t -> 'a or_error

wait_block fut blocks the current thread until fut is resolved, and returns its value.

NOTE: A word of warning: this will monopolize the calling thread until the future resolves. This can also easily cause deadlocks, if enough threads in a pool call wait_block on futures running on the same pool or a pool depending on it.

A good rule to avoid deadlocks is to run this from outside of any pool, or to have an acyclic order between pools where wait_block is only called from a pool on futures evaluated in a pool that comes lower in the hierarchy. If this rule is broken, it is possible for all threads in a pool to wait for futures that can only make progress on these same threads, hence the deadlock.

val wait_block_exn : 'a t -> 'a

Same as wait_block but re-raises the exception if the future failed.

Infix operators

These combinators run on either the current pool (if present), or on the same thread that just fulfilled the previous future if not.

They were previously present as module Infix_local and val infix, but are now simplified.

  • since 0.5
module Infix : sig ... end
include module type of Infix
  • since 0.5
val (>|=) : 'a t -> ('a -> 'b) -> 'b t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val let+ : 'a t -> ('a -> 'b) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val let* : 'a t -> ('a -> 'b t) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
module Infix_local = Infix
diff --git a/dev/moonpool/Moonpool/Immediate_runner/For_runner_implementors/index.html b/dev/moonpool/Moonpool/Immediate_runner/For_runner_implementors/index.html index 95cd7082..53b9020d 100644 --- a/dev/moonpool/Moonpool/Immediate_runner/For_runner_implementors/index.html +++ b/dev/moonpool/Moonpool/Immediate_runner/For_runner_implementors/index.html @@ -5,4 +5,4 @@ shutdown:(wait:bool -> unit -> unit) -> run_async:(task -> unit) -> unit -> - t

Create a new runner.

NOTE: the runner should support DLA and Suspend_ on OCaml 5.x, so that Fork_join and other 5.x features work properly.

val k_cur_runner : t option ref Moonpool__.Thread_local_storage_.key
+ t

Create a new runner.

NOTE: the runner should support DLA and Suspend_ on OCaml 5.x, so that Fork_join and other 5.x features work properly.

val k_cur_runner : t option Stdlib.ref Moonpool__.Thread_local_storage_.key
diff --git a/dev/moonpool/Moonpool/Immediate_runner/index.html b/dev/moonpool/Moonpool/Immediate_runner/index.html index 44cb049e..8834e750 100644 --- a/dev/moonpool/Moonpool/Immediate_runner/index.html +++ b/dev/moonpool/Moonpool/Immediate_runner/index.html @@ -1,2 +1,2 @@ -Immediate_runner (moonpool.Moonpool.Immediate_runner)

Module Moonpool.Immediate_runner

Runner that runs tasks immediately in the caller thread.

Whenever a task is submitted to this runner via Runner.run_async r task, the task is run immediately in the caller thread as task(). There are no background threads, no resource, this is just a trivial implementation of the interface.

This can be useful when an implementation needs a runner, but there isn't enough work to justify starting an actual full thread pool.

Another situation is when threads cannot be used at all (e.g. because you plan to call Unix.fork later).

include module type of Runner
type task = unit -> unit
type t

A runner.

If a runner is no longer needed, shutdown can be used to signal all worker threads in it to stop (after they finish their work), and wait for them to stop.

The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simple the single runtime on OCaml 4).

val size : t -> int

Number of threads/workers.

val num_tasks : t -> int

Current number of tasks. This is at best a snapshot, useful for metrics and debugging.

val shutdown : t -> unit

Shutdown the runner and wait for it to terminate. Idempotent.

val shutdown_without_waiting : t -> unit

Shutdown the pool, and do not wait for it to terminate. Idempotent.

exception Shutdown
val run_async : t -> task -> unit

run_async pool f schedules f for later execution on the runner in one of the threads. f() will run on one of the runner's worker threads/domains.

  • raises Shutdown

    if the runner was shut down before run_async was called.

val run_wait_block : t -> (unit -> 'a) -> 'a

run_wait_block pool f schedules f for later execution on the pool, like run_async. It then blocks the current thread until f() is done executing, and returns its result. If f() raises an exception, then run_wait_block pool f will raise it as well.

NOTE be careful with deadlocks (see notes in Fut.wait_block about the required discipline to avoid deadlocks).

module For_runner_implementors : sig ... end

This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

val get_current_runner : unit -> t option

Access the current runner. This returns Some r if the call happens on a thread that belongs in a runner.

  • since NEXT_RELEASE
val runner : t

The trivial runner that actually runs tasks at the calling point.

+Immediate_runner (moonpool.Moonpool.Immediate_runner)

Module Moonpool.Immediate_runner

Runner that runs tasks immediately in the caller thread.

Whenever a task is submitted to this runner via Runner.run_async r task, the task is run immediately in the caller thread as task(). There are no background threads, no resource, this is just a trivial implementation of the interface.

This can be useful when an implementation needs a runner, but there isn't enough work to justify starting an actual full thread pool.

Another situation is when threads cannot be used at all (e.g. because you plan to call Unix.fork later).

include module type of Runner
type task = unit -> unit
type t

A runner.

If a runner is no longer needed, shutdown can be used to signal all worker threads in it to stop (after they finish their work), and wait for them to stop.

The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simple the single runtime on OCaml 4).

val size : t -> int

Number of threads/workers.

val num_tasks : t -> int

Current number of tasks. This is at best a snapshot, useful for metrics and debugging.

val shutdown : t -> unit

Shutdown the runner and wait for it to terminate. Idempotent.

val shutdown_without_waiting : t -> unit

Shutdown the pool, and do not wait for it to terminate. Idempotent.

exception Shutdown
val run_async : t -> task -> unit

run_async pool f schedules f for later execution on the runner in one of the threads. f() will run on one of the runner's worker threads/domains.

  • raises Shutdown

    if the runner was shut down before run_async was called.

val run_wait_block : t -> (unit -> 'a) -> 'a

run_wait_block pool f schedules f for later execution on the pool, like run_async. It then blocks the current thread until f() is done executing, and returns its result. If f() raises an exception, then run_wait_block pool f will raise it as well.

NOTE be careful with deadlocks (see notes in Fut.wait_block about the required discipline to avoid deadlocks).

module For_runner_implementors : sig ... end

This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

val get_current_runner : unit -> t option

Access the current runner. This returns Some r if the call happens on a thread that belongs in a runner.

  • since 0.5
val runner : t

The trivial runner that actually runs tasks at the calling point.

diff --git a/dev/moonpool/Moonpool/Runner/For_runner_implementors/index.html b/dev/moonpool/Moonpool/Runner/For_runner_implementors/index.html index 425f6a73..0660cf44 100644 --- a/dev/moonpool/Moonpool/Runner/For_runner_implementors/index.html +++ b/dev/moonpool/Moonpool/Runner/For_runner_implementors/index.html @@ -5,4 +5,4 @@ shutdown:(wait:bool -> unit -> unit) -> run_async:(task -> unit) -> unit -> - t

Create a new runner.

NOTE: the runner should support DLA and Suspend_ on OCaml 5.x, so that Fork_join and other 5.x features work properly.

val k_cur_runner : t option ref Moonpool__.Thread_local_storage_.key
+ t

Create a new runner.

NOTE: the runner should support DLA and Suspend_ on OCaml 5.x, so that Fork_join and other 5.x features work properly.

val k_cur_runner : t option Stdlib.ref Moonpool__.Thread_local_storage_.key
diff --git a/dev/moonpool/Moonpool/Runner/index.html b/dev/moonpool/Moonpool/Runner/index.html index d18614c4..9d33b91b 100644 --- a/dev/moonpool/Moonpool/Runner/index.html +++ b/dev/moonpool/Moonpool/Runner/index.html @@ -1,2 +1,2 @@ -Runner (moonpool.Moonpool.Runner)

Module Moonpool.Runner

Interface for runners.

This provides an abstraction for running tasks in the background, which is implemented by various thread pools.

type task = unit -> unit
type t

A runner.

If a runner is no longer needed, shutdown can be used to signal all worker threads in it to stop (after they finish their work), and wait for them to stop.

The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simple the single runtime on OCaml 4).

val size : t -> int

Number of threads/workers.

val num_tasks : t -> int

Current number of tasks. This is at best a snapshot, useful for metrics and debugging.

val shutdown : t -> unit

Shutdown the runner and wait for it to terminate. Idempotent.

val shutdown_without_waiting : t -> unit

Shutdown the pool, and do not wait for it to terminate. Idempotent.

exception Shutdown
val run_async : t -> task -> unit

run_async pool f schedules f for later execution on the runner in one of the threads. f() will run on one of the runner's worker threads/domains.

  • raises Shutdown

    if the runner was shut down before run_async was called.

val run_wait_block : t -> (unit -> 'a) -> 'a

run_wait_block pool f schedules f for later execution on the pool, like run_async. It then blocks the current thread until f() is done executing, and returns its result. If f() raises an exception, then run_wait_block pool f will raise it as well.

NOTE be careful with deadlocks (see notes in Fut.wait_block about the required discipline to avoid deadlocks).

module For_runner_implementors : sig ... end

This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

val get_current_runner : unit -> t option

Access the current runner. This returns Some r if the call happens on a thread that belongs in a runner.

  • since NEXT_RELEASE
+Runner (moonpool.Moonpool.Runner)

Module Moonpool.Runner

Interface for runners.

This provides an abstraction for running tasks in the background, which is implemented by various thread pools.

type task = unit -> unit
type t

A runner.

If a runner is no longer needed, shutdown can be used to signal all worker threads in it to stop (after they finish their work), and wait for them to stop.

The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simple the single runtime on OCaml 4).

val size : t -> int

Number of threads/workers.

val num_tasks : t -> int

Current number of tasks. This is at best a snapshot, useful for metrics and debugging.

val shutdown : t -> unit

Shutdown the runner and wait for it to terminate. Idempotent.

val shutdown_without_waiting : t -> unit

Shutdown the pool, and do not wait for it to terminate. Idempotent.

exception Shutdown
val run_async : t -> task -> unit

run_async pool f schedules f for later execution on the runner in one of the threads. f() will run on one of the runner's worker threads/domains.

  • raises Shutdown

    if the runner was shut down before run_async was called.

val run_wait_block : t -> (unit -> 'a) -> 'a

run_wait_block pool f schedules f for later execution on the pool, like run_async. It then blocks the current thread until f() is done executing, and returns its result. If f() raises an exception, then run_wait_block pool f will raise it as well.

NOTE be careful with deadlocks (see notes in Fut.wait_block about the required discipline to avoid deadlocks).

module For_runner_implementors : sig ... end

This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

val get_current_runner : unit -> t option

Access the current runner. This returns Some r if the call happens on a thread that belongs in a runner.

  • since 0.5
diff --git a/dev/moonpool/Moonpool/Ws_pool/For_runner_implementors/index.html b/dev/moonpool/Moonpool/Ws_pool/For_runner_implementors/index.html index 1cd43c2b..6d730e3c 100644 --- a/dev/moonpool/Moonpool/Ws_pool/For_runner_implementors/index.html +++ b/dev/moonpool/Moonpool/Ws_pool/For_runner_implementors/index.html @@ -5,4 +5,4 @@ shutdown:(wait:bool -> unit -> unit) -> run_async:(task -> unit) -> unit -> - t

Create a new runner.

NOTE: the runner should support DLA and Suspend_ on OCaml 5.x, so that Fork_join and other 5.x features work properly.

val k_cur_runner : t option ref Moonpool__.Thread_local_storage_.key
+ t

Create a new runner.

NOTE: the runner should support DLA and Suspend_ on OCaml 5.x, so that Fork_join and other 5.x features work properly.

val k_cur_runner : t option Stdlib.ref Moonpool__.Thread_local_storage_.key
diff --git a/dev/moonpool/Moonpool/Ws_pool/index.html b/dev/moonpool/Moonpool/Ws_pool/index.html index a851efcc..5368b4de 100644 --- a/dev/moonpool/Moonpool/Ws_pool/index.html +++ b/dev/moonpool/Moonpool/Ws_pool/index.html @@ -1,5 +1,5 @@ -Ws_pool (moonpool.Moonpool.Ws_pool)

Module Moonpool.Ws_pool

Work-stealing thread pool.

A pool of threads with a worker-stealing scheduler. The pool contains a fixed number of threads that wait for work items to come, process these, and loop.

This is good for CPU-intensive tasks that feature a lot of small tasks. Note that tasks will not always be processed in the order they are scheduled, so this is not great for workloads where the latency of individual tasks matter (for that see Fifo_pool).

This implements Runner.t since 0.3.

If a pool is no longer needed, shutdown can be used to signal all threads in it to stop (after they finish their work), and wait for them to stop.

The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simply the single runtime on OCaml 4).

include module type of Runner
type task = unit -> unit
type t

A runner.

If a runner is no longer needed, shutdown can be used to signal all worker threads in it to stop (after they finish their work), and wait for them to stop.

The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simple the single runtime on OCaml 4).

val size : t -> int

Number of threads/workers.

val num_tasks : t -> int

Current number of tasks. This is at best a snapshot, useful for metrics and debugging.

val shutdown : t -> unit

Shutdown the runner and wait for it to terminate. Idempotent.

val shutdown_without_waiting : t -> unit

Shutdown the pool, and do not wait for it to terminate. Idempotent.

exception Shutdown
val run_async : t -> task -> unit

run_async pool f schedules f for later execution on the runner in one of the threads. f() will run on one of the runner's worker threads/domains.

  • raises Shutdown

    if the runner was shut down before run_async was called.

val run_wait_block : t -> (unit -> 'a) -> 'a

run_wait_block pool f schedules f for later execution on the pool, like run_async. It then blocks the current thread until f() is done executing, and returns its result. If f() raises an exception, then run_wait_block pool f will raise it as well.

NOTE be careful with deadlocks (see notes in Fut.wait_block about the required discipline to avoid deadlocks).

module For_runner_implementors : sig ... end

This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

val get_current_runner : unit -> t option

Access the current runner. This returns Some r if the call happens on a thread that belongs in a runner.

  • since NEXT_RELEASE
type ('a, 'b) create_args = +Ws_pool (moonpool.Moonpool.Ws_pool)

Module Moonpool.Ws_pool

Work-stealing thread pool.

A pool of threads with a worker-stealing scheduler. The pool contains a fixed number of threads that wait for work items to come, process these, and loop.

This is good for CPU-intensive tasks that feature a lot of small tasks. Note that tasks will not always be processed in the order they are scheduled, so this is not great for workloads where the latency of individual tasks matter (for that see Fifo_pool).

This implements Runner.t since 0.3.

If a pool is no longer needed, shutdown can be used to signal all threads in it to stop (after they finish their work), and wait for them to stop.

The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simply the single runtime on OCaml 4).

include module type of Runner
type task = unit -> unit
type t

A runner.

If a runner is no longer needed, shutdown can be used to signal all worker threads in it to stop (after they finish their work), and wait for them to stop.

The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simple the single runtime on OCaml 4).

val size : t -> int

Number of threads/workers.

val num_tasks : t -> int

Current number of tasks. This is at best a snapshot, useful for metrics and debugging.

val shutdown : t -> unit

Shutdown the runner and wait for it to terminate. Idempotent.

val shutdown_without_waiting : t -> unit

Shutdown the pool, and do not wait for it to terminate. Idempotent.

exception Shutdown
val run_async : t -> task -> unit

run_async pool f schedules f for later execution on the runner in one of the threads. f() will run on one of the runner's worker threads/domains.

  • raises Shutdown

    if the runner was shut down before run_async was called.

val run_wait_block : t -> (unit -> 'a) -> 'a

run_wait_block pool f schedules f for later execution on the pool, like run_async. It then blocks the current thread until f() is done executing, and returns its result. If f() raises an exception, then run_wait_block pool f will raise it as well.

NOTE be careful with deadlocks (see notes in Fut.wait_block about the required discipline to avoid deadlocks).

module For_runner_implementors : sig ... end

This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

val get_current_runner : unit -> t option

Access the current runner. This returns Some r if the call happens on a thread that belongs in a runner.

  • since 0.5
type ('a, 'b) create_args = ?on_init_thread:(dom_id:int -> t_id:int -> unit -> unit) -> ?on_exit_thread:(dom_id:int -> t_id:int -> unit -> unit) -> ?on_exn:(exn -> Stdlib.Printexc.raw_backtrace -> unit) -> diff --git a/dev/moonpool/Moonpool/index.html b/dev/moonpool/Moonpool/index.html index 1c21d559..c8bbb62c 100644 --- a/dev/moonpool/Moonpool/index.html +++ b/dev/moonpool/Moonpool/index.html @@ -1,2 +1,2 @@ -Moonpool (moonpool.Moonpool)

Module Moonpool

Moonpool

A pool within a bigger pool (ie the ocean). Here, we're talking about pools of Thread.t that are dispatched over several Domain.t to enable parallelism.

We provide several implementations of pools with distinct scheduling strategies, alongside some concurrency primitives such as guarding locks (Lock.t) and futures (Fut.t).

module Ws_pool : sig ... end

Work-stealing thread pool.

module Fifo_pool : sig ... end

A simple thread pool in FIFO order.

module Runner : sig ... end

Interface for runners.

module Immediate_runner : sig ... end

Runner that runs tasks immediately in the caller thread.

module Pool = Fifo_pool

Default pool. Please explicitly pick an implementation instead.

val start_thread_on_some_domain : ('a -> unit) -> 'a -> Thread.t

Similar to Thread.create, but it picks a background domain at random to run the thread. This ensures that we don't always pick the same domain to run all the various threads needed in an application (timers, event loops, etc.)

val run_async : Runner.t -> (unit -> unit) -> unit

run_async runner task schedules the task to run on the given runner. This means task() will be executed at some point in the future, possibly in another thread.

  • since NEXT_RELEASE

Number of threads recommended to saturate the CPU. For IO pools this makes little sense (you might want more threads than this because many of them will be blocked most of the time).

  • since NEXT_RELEASE
val spawn : on:Runner.t -> (unit -> 'a) -> 'a Fut.t

spawn ~on f runs f() on the runner (a thread pool typically) and returns a future result for it. See Fut.spawn.

  • since NEXT_RELEASE
val spawn_on_current_runner : (unit -> 'a) -> 'a Fut.t

See Fut.spawn_on_current_runner.

  • since NEXT_RELEASE
val await : 'a Fut.t -> 'a

Await a future. See await. Only on OCaml >= 5.0.

  • since NEXT_RELEASE
module Lock : sig ... end

Mutex-protected resource.

module Fut : sig ... end

Futures.

module Chan : sig ... end

Channels.

module Fork_join : sig ... end

Fork-join primitives.

module Thread_local_storage : sig ... end

Thread local storage

module Blocking_queue : sig ... end

A simple blocking queue.

module Bounded_queue : sig ... end

A blocking queue of finite size.

module Atomic : sig ... end

Atomic values.

+Moonpool (moonpool.Moonpool)

Module Moonpool

Moonpool

A pool within a bigger pool (ie the ocean). Here, we're talking about pools of Thread.t that are dispatched over several Domain.t to enable parallelism.

We provide several implementations of pools with distinct scheduling strategies, alongside some concurrency primitives such as guarding locks (Lock.t) and futures (Fut.t).

module Ws_pool : sig ... end

Work-stealing thread pool.

module Fifo_pool : sig ... end

A simple thread pool in FIFO order.

module Runner : sig ... end

Interface for runners.

module Immediate_runner : sig ... end

Runner that runs tasks immediately in the caller thread.

module Pool = Fifo_pool

Default pool. Please explicitly pick an implementation instead.

val start_thread_on_some_domain : ('a -> unit) -> 'a -> Thread.t

Similar to Thread.create, but it picks a background domain at random to run the thread. This ensures that we don't always pick the same domain to run all the various threads needed in an application (timers, event loops, etc.)

val run_async : Runner.t -> (unit -> unit) -> unit

run_async runner task schedules the task to run on the given runner. This means task() will be executed at some point in the future, possibly in another thread.

  • since 0.5

Number of threads recommended to saturate the CPU. For IO pools this makes little sense (you might want more threads than this because many of them will be blocked most of the time).

  • since 0.5
val spawn : on:Runner.t -> (unit -> 'a) -> 'a Fut.t

spawn ~on f runs f() on the runner (a thread pool typically) and returns a future result for it. See Fut.spawn.

  • since 0.5
val spawn_on_current_runner : (unit -> 'a) -> 'a Fut.t
val await : 'a Fut.t -> 'a

Await a future. See await. Only on OCaml >= 5.0.

  • since 0.5
module Lock : sig ... end

Mutex-protected resource.

module Fut : sig ... end

Futures.

module Chan : sig ... end

Channels.

module Fork_join : sig ... end

Fork-join primitives.

module Thread_local_storage : sig ... end

Thread local storage

module Blocking_queue : sig ... end

A simple blocking queue.

module Bounded_queue : sig ... end

A blocking queue of finite size.

module Atomic : sig ... end

Atomic values.

diff --git a/dev/moonpool/_doc-dir/CHANGES.md b/dev/moonpool/_doc-dir/CHANGES.md index 86f2ca1e..e7c9665b 100644 --- a/dev/moonpool/_doc-dir/CHANGES.md +++ b/dev/moonpool/_doc-dir/CHANGES.md @@ -1,4 +1,40 @@ +# 0.5 + +## features + +- add `Bb_queue.transfer` + -add `Bb_queue.to_{iter,gen,seq}` +- add `Fifo_pool`, a simple pool with a single blocking queue for + workloads with coarse granularity tasks that value + latency (e.g. a web server) +- add a work-stealing pool for heavy compute workloads that + feature a lot of await/fork-join, with a lot of help + from Vesa Karvonen (@polytypic) +- add `Fut.spawn_on_current_runner` +- add `Runner.{spawn_on_current_runner, await}` +- add a few more toplevel aliases in `Moonpool` itself +- add `No_runner`: a runner that runs tasks synchronously in the caller +- on shutdown, pools will finish running all present tasks before + closing. New tasks are immediately rejected. + +- use an optional dependency on `thread-local-storage` to + implement work stealing and `spawn_on_current_runner` + +## optimizations + +- use the main domain to spawn threads on it. This means we can really + use all cores, not all but one. +- in `Fork_join.both`, only one of the two sides schedules a task, + the other runs in the current thread. This reduces scheduling overhead. +- compare to domainslib in benchmarks. With the WS pool we're now slightly + ahead in terms of overhead on the recursive fib benchmark. + +## breaking + +- deprecate `Pool`, now an alias to `Fifo_pool` + + # 0.4 - add `Fut.{reify_error,bind_reify_error}` diff --git a/dev/ocaml/Build_path_prefix_map/index.html b/dev/ocaml/Build_path_prefix_map/index.html index 3043a3ea..13e23130 100644 --- a/dev/ocaml/Build_path_prefix_map/index.html +++ b/dev/ocaml/Build_path_prefix_map/index.html @@ -1,2 +1,2 @@ -Build_path_prefix_map (ocaml.Build_path_prefix_map)

Module Build_path_prefix_map

Rewrite paths for reproducible builds

Warning: this module is unstable and part of compiler-libs.

type path = string
type path_prefix = string
type error_message = string
val encode_prefix : path_prefix -> string
val decode_prefix : string -> (path_prefix, error_message) result
type pair = {
  1. target : path_prefix;
  2. source : path_prefix;
}
val encode_pair : pair -> string
val decode_pair : string -> (pair, error_message) result
type map = pair option list
val encode_map : map -> string
val decode_map : string -> (map, error_message) result
val rewrite_opt : map -> path -> path option

rewrite_opt map path tries to find a source in map that is a prefix of the input path. If it succeeds, it replaces this prefix with the corresponding target. If it fails, it just returns None.

val rewrite : map -> path -> path
+Build_path_prefix_map (ocaml.Build_path_prefix_map)

Module Build_path_prefix_map

Rewrite paths for reproducible builds

Warning: this module is unstable and part of compiler-libs.

type path = string
type path_prefix = string
type error_message = string
val encode_prefix : path_prefix -> string
val decode_prefix : string -> (path_prefix, error_message) Stdlib.result
type pair = {
  1. target : path_prefix;
  2. source : path_prefix;
}
val encode_pair : pair -> string
val decode_pair : string -> (pair, error_message) Stdlib.result
type map = pair option list
val encode_map : map -> string
val decode_map : string -> (map, error_message) Stdlib.result
val rewrite_opt : map -> path -> path option

rewrite_opt map path tries to find a source in map that is a prefix of the input path. If it succeeds, it replaces this prefix with the corresponding target. If it fails, it just returns None.

val rewrite : map -> path -> path
diff --git a/dev/ocaml/Bytesections/index.html b/dev/ocaml/Bytesections/index.html index 5a267071..d50d8494 100644 --- a/dev/ocaml/Bytesections/index.html +++ b/dev/ocaml/Bytesections/index.html @@ -1,2 +1,2 @@ -Bytesections (ocaml.Bytesections)

Module Bytesections

Recording sections written to a bytecode executable file

val init_record : out_channel -> unit
val record : out_channel -> string -> unit
val write_toc_and_trailer : out_channel -> unit

Reading sections from a bytecode executable file

val read_toc : in_channel -> unit
exception Bad_magic_number
val toc : unit -> (string * int) list
val seek_section : in_channel -> string -> int
val read_section_string : in_channel -> string -> string
val read_section_struct : in_channel -> string -> 'a
val pos_first_section : in_channel -> int
val reset : unit -> unit
+Bytesections (ocaml.Bytesections)

Module Bytesections

Recording sections written to a bytecode executable file

val init_record : Stdlib.out_channel -> unit
val record : Stdlib.out_channel -> string -> unit
val write_toc_and_trailer : Stdlib.out_channel -> unit

Reading sections from a bytecode executable file

val read_toc : Stdlib.in_channel -> unit
exception Bad_magic_number
val toc : unit -> (string * int) list
val seek_section : Stdlib.in_channel -> string -> int
val read_section_string : Stdlib.in_channel -> string -> string
val read_section_struct : Stdlib.in_channel -> string -> 'a
val pos_first_section : Stdlib.in_channel -> int
val reset : unit -> unit
diff --git a/dev/ocaml/Config/index.html b/dev/ocaml/Config/index.html index 0bc82794..1fc6c7e8 100644 --- a/dev/ocaml/Config/index.html +++ b/dev/ocaml/Config/index.html @@ -1,2 +1,2 @@ -Config (ocaml.Config)

Module Config

System configuration

Warning: this module is unstable and part of compiler-libs.

val version : string

The current version number of the system

val bindir : string

The directory containing the binary programs

val standard_library : string

The directory containing the standard libraries

val ccomp_type : string

The "kind" of the C compiler, assembler and linker used: one of "cc" (for Unix-style C compilers) "msvc" (for Microsoft Visual C++ and MASM)

val c_compiler : string

The compiler to use for compiling C files

val c_output_obj : string

Name of the option of the C compiler for specifying the output file

val c_has_debug_prefix_map : bool

Whether the C compiler supports -fdebug-prefix-map

val as_has_debug_prefix_map : bool

Whether the assembler supports --debug-prefix-map

val ocamlc_cflags : string

The flags ocamlc should pass to the C compiler

val ocamlc_cppflags : string

The flags ocamlc should pass to the C preprocessor

val ocamlopt_cflags : string
  • deprecated

    ocamlc_cflags should be used instead. The flags ocamlopt should pass to the C compiler

val ocamlopt_cppflags : string
  • deprecated

    ocamlc_cppflags should be used instead. The flags ocamlopt should pass to the C preprocessor

val bytecomp_c_libraries : string

The C libraries to link with custom runtimes

val native_c_libraries : string

The C libraries to link with native-code programs

val native_pack_linker : string

The linker to use for packaging (ocamlopt -pack) and for partial links (ocamlopt -output-obj).

val mkdll : string

The linker command line to build dynamic libraries.

val mkexe : string

The linker command line to build executables.

val mkmaindll : string

The linker command line to build main programs as dlls.

val default_rpath : string

Option to add a directory to be searched for libraries at runtime (used by ocamlmklib)

val mksharedlibrpath : string

Option to add a directory to be searched for shared libraries at runtime (used by ocamlmklib)

val ar : string

Name of the ar command, or "" if not needed (MSVC)

val interface_suffix : string ref

Suffix for interface file names

val exec_magic_number : string

Magic number for bytecode executable files

val cmi_magic_number : string

Magic number for compiled interface files

val cmo_magic_number : string

Magic number for object bytecode files

val cma_magic_number : string

Magic number for archive files

val cmx_magic_number : string

Magic number for compilation unit descriptions

val cmxa_magic_number : string

Magic number for libraries of compilation unit descriptions

val ast_intf_magic_number : string

Magic number for file holding an interface syntax tree

val ast_impl_magic_number : string

Magic number for file holding an implementation syntax tree

val cmxs_magic_number : string

Magic number for dynamically-loadable plugins

val cmt_magic_number : string

Magic number for compiled interface files

val linear_magic_number : string

Magic number for Linear internal representation files

val max_tag : int

Biggest tag that can be stored in the header of a regular block.

val lazy_tag : int

Normally the same as Obj.lazy_tag. Separate definition because of technical reasons for bootstrapping.

val max_young_wosize : int

Maximal size of arrays that are directly allocated in the minor heap

val stack_threshold : int

Size in words of safe area at bottom of VM stack, see runtime/caml/config.h

val stack_safety_margin : int

Size in words of the safety margin between the bottom of the stack and the stack pointer. This margin can be used by intermediate computations of some instructions, or the event handler.

val architecture : string

Name of processor type for the native-code compiler

val model : string

Name of processor submodel for the native-code compiler

val system : string

Name of operating system for the native-code compiler

val asm : string

The assembler (and flags) to use for assembling ocamlopt-generated code.

val asm_cfi_supported : bool

Whether assembler understands CFI directives

val with_frame_pointers : bool

Whether assembler should maintain frame pointers

val ext_obj : string

Extension for object files, e.g. .o under Unix.

val ext_asm : string

Extension for assembler files, e.g. .s under Unix.

val ext_lib : string

Extension for library files, e.g. .a under Unix.

val ext_dll : string

Extension for dynamically-loaded libraries, e.g. .so under Unix.

val ext_exe : string

Extension for executable programs, e.g. .exe under Windows.

  • since 4.12.0
val default_executable_name : string

Name of executable produced by linking if none is given with -o, e.g. a.out under Unix.

val systhread_supported : bool

Whether the system thread library is implemented

val flexdll_dirs : string list

Directories needed for the FlexDLL objects

val host : string

Whether the compiler is a cross-compiler

val target : string

Whether the compiler is a cross-compiler

val flambda : bool

Whether the compiler was configured for flambda

val with_flambda_invariants : bool

Whether the invariants checks for flambda are enabled

val with_cmm_invariants : bool

Whether the invariants checks for Cmm are enabled

val profinfo : bool

Whether the compiler was configured for profiling

val profinfo_width : int

How many bits are to be used in values' headers for profiling information

val flat_float_array : bool

Whether the compiler and runtime automagically flatten float arrays

val function_sections : bool

Whether the compiler was configured to generate each function in a separate section

val windows_unicode : bool

Whether Windows Unicode runtime is enabled

val naked_pointers : bool

Whether the runtime supports naked pointers

  • since 4.14.0
val supports_shared_libraries : bool

Whether shared libraries are supported

  • since 4.08.0
val afl_instrument : bool

Whether afl-fuzz instrumentation is generated by default

val print_config : out_channel -> unit

Access to configuration values

val config_var : string -> string option

the configuration value of a variable, if it exists

+Config (ocaml.Config)

Module Config

System configuration

Warning: this module is unstable and part of compiler-libs.

val version : string

The current version number of the system

val bindir : string

The directory containing the binary programs

val standard_library : string

The directory containing the standard libraries

val ccomp_type : string

The "kind" of the C compiler, assembler and linker used: one of "cc" (for Unix-style C compilers) "msvc" (for Microsoft Visual C++ and MASM)

val c_compiler : string

The compiler to use for compiling C files

val c_output_obj : string

Name of the option of the C compiler for specifying the output file

val c_has_debug_prefix_map : bool

Whether the C compiler supports -fdebug-prefix-map

val as_has_debug_prefix_map : bool

Whether the assembler supports --debug-prefix-map

val ocamlc_cflags : string

The flags ocamlc should pass to the C compiler

val ocamlc_cppflags : string

The flags ocamlc should pass to the C preprocessor

val ocamlopt_cflags : string
  • deprecated

    ocamlc_cflags should be used instead. The flags ocamlopt should pass to the C compiler

val ocamlopt_cppflags : string
  • deprecated

    ocamlc_cppflags should be used instead. The flags ocamlopt should pass to the C preprocessor

val bytecomp_c_libraries : string

The C libraries to link with custom runtimes

val native_c_libraries : string

The C libraries to link with native-code programs

val native_pack_linker : string

The linker to use for packaging (ocamlopt -pack) and for partial links (ocamlopt -output-obj).

val mkdll : string

The linker command line to build dynamic libraries.

val mkexe : string

The linker command line to build executables.

val mkmaindll : string

The linker command line to build main programs as dlls.

val default_rpath : string

Option to add a directory to be searched for libraries at runtime (used by ocamlmklib)

val mksharedlibrpath : string

Option to add a directory to be searched for shared libraries at runtime (used by ocamlmklib)

val ar : string

Name of the ar command, or "" if not needed (MSVC)

val interface_suffix : string Stdlib.ref

Suffix for interface file names

val exec_magic_number : string

Magic number for bytecode executable files

val cmi_magic_number : string

Magic number for compiled interface files

val cmo_magic_number : string

Magic number for object bytecode files

val cma_magic_number : string

Magic number for archive files

val cmx_magic_number : string

Magic number for compilation unit descriptions

val cmxa_magic_number : string

Magic number for libraries of compilation unit descriptions

val ast_intf_magic_number : string

Magic number for file holding an interface syntax tree

val ast_impl_magic_number : string

Magic number for file holding an implementation syntax tree

val cmxs_magic_number : string

Magic number for dynamically-loadable plugins

val cmt_magic_number : string

Magic number for compiled interface files

val linear_magic_number : string

Magic number for Linear internal representation files

val max_tag : int

Biggest tag that can be stored in the header of a regular block.

val lazy_tag : int

Normally the same as Obj.lazy_tag. Separate definition because of technical reasons for bootstrapping.

val max_young_wosize : int

Maximal size of arrays that are directly allocated in the minor heap

val stack_threshold : int

Size in words of safe area at bottom of VM stack, see runtime/caml/config.h

val stack_safety_margin : int

Size in words of the safety margin between the bottom of the stack and the stack pointer. This margin can be used by intermediate computations of some instructions, or the event handler.

val architecture : string

Name of processor type for the native-code compiler

val model : string

Name of processor submodel for the native-code compiler

val system : string

Name of operating system for the native-code compiler

val asm : string

The assembler (and flags) to use for assembling ocamlopt-generated code.

val asm_cfi_supported : bool

Whether assembler understands CFI directives

val with_frame_pointers : bool

Whether assembler should maintain frame pointers

val ext_obj : string

Extension for object files, e.g. .o under Unix.

val ext_asm : string

Extension for assembler files, e.g. .s under Unix.

val ext_lib : string

Extension for library files, e.g. .a under Unix.

val ext_dll : string

Extension for dynamically-loaded libraries, e.g. .so under Unix.

val ext_exe : string

Extension for executable programs, e.g. .exe under Windows.

  • since 4.12.0
val default_executable_name : string

Name of executable produced by linking if none is given with -o, e.g. a.out under Unix.

val systhread_supported : bool

Whether the system thread library is implemented

val flexdll_dirs : string list

Directories needed for the FlexDLL objects

val host : string

Whether the compiler is a cross-compiler

val target : string

Whether the compiler is a cross-compiler

val flambda : bool

Whether the compiler was configured for flambda

val with_flambda_invariants : bool

Whether the invariants checks for flambda are enabled

val with_cmm_invariants : bool

Whether the invariants checks for Cmm are enabled

val profinfo : bool

Whether the compiler was configured for profiling

val profinfo_width : int

How many bits are to be used in values' headers for profiling information

val flat_float_array : bool

Whether the compiler and runtime automagically flatten float arrays

val function_sections : bool

Whether the compiler was configured to generate each function in a separate section

val windows_unicode : bool

Whether Windows Unicode runtime is enabled

val naked_pointers : bool

Whether the runtime supports naked pointers

  • since 4.14.0
val supports_shared_libraries : bool

Whether shared libraries are supported

  • since 4.08.0
val afl_instrument : bool

Whether afl-fuzz instrumentation is generated by default

val print_config : Stdlib.out_channel -> unit

Access to configuration values

val config_var : string -> string option

the configuration value of a variable, if it exists

diff --git a/dev/ocaml/Config_boot/index.html b/dev/ocaml/Config_boot/index.html index 186d5aed..bdf73b4f 100644 --- a/dev/ocaml/Config_boot/index.html +++ b/dev/ocaml/Config_boot/index.html @@ -1,2 +1,2 @@ -Config_boot (ocaml.Config_boot)

Module Config_boot

System configuration

Warning: this module is unstable and part of compiler-libs.

val version : string

The current version number of the system

val bindir : string

The directory containing the binary programs

val standard_library : string

The directory containing the standard libraries

val ccomp_type : string

The "kind" of the C compiler, assembler and linker used: one of "cc" (for Unix-style C compilers) "msvc" (for Microsoft Visual C++ and MASM)

val c_compiler : string

The compiler to use for compiling C files

val c_output_obj : string

Name of the option of the C compiler for specifying the output file

val c_has_debug_prefix_map : bool

Whether the C compiler supports -fdebug-prefix-map

val as_has_debug_prefix_map : bool

Whether the assembler supports --debug-prefix-map

val ocamlc_cflags : string

The flags ocamlc should pass to the C compiler

val ocamlc_cppflags : string

The flags ocamlc should pass to the C preprocessor

val ocamlopt_cflags : string
  • deprecated

    ocamlc_cflags should be used instead. The flags ocamlopt should pass to the C compiler

val ocamlopt_cppflags : string
  • deprecated

    ocamlc_cppflags should be used instead. The flags ocamlopt should pass to the C preprocessor

val bytecomp_c_libraries : string

The C libraries to link with custom runtimes

val native_c_libraries : string

The C libraries to link with native-code programs

val native_pack_linker : string

The linker to use for packaging (ocamlopt -pack) and for partial links (ocamlopt -output-obj).

val mkdll : string

The linker command line to build dynamic libraries.

val mkexe : string

The linker command line to build executables.

val mkmaindll : string

The linker command line to build main programs as dlls.

val default_rpath : string

Option to add a directory to be searched for libraries at runtime (used by ocamlmklib)

val mksharedlibrpath : string

Option to add a directory to be searched for shared libraries at runtime (used by ocamlmklib)

val ar : string

Name of the ar command, or "" if not needed (MSVC)

val interface_suffix : string ref

Suffix for interface file names

val exec_magic_number : string

Magic number for bytecode executable files

val cmi_magic_number : string

Magic number for compiled interface files

val cmo_magic_number : string

Magic number for object bytecode files

val cma_magic_number : string

Magic number for archive files

val cmx_magic_number : string

Magic number for compilation unit descriptions

val cmxa_magic_number : string

Magic number for libraries of compilation unit descriptions

val ast_intf_magic_number : string

Magic number for file holding an interface syntax tree

val ast_impl_magic_number : string

Magic number for file holding an implementation syntax tree

val cmxs_magic_number : string

Magic number for dynamically-loadable plugins

val cmt_magic_number : string

Magic number for compiled interface files

val linear_magic_number : string

Magic number for Linear internal representation files

val max_tag : int

Biggest tag that can be stored in the header of a regular block.

val lazy_tag : int

Normally the same as Obj.lazy_tag. Separate definition because of technical reasons for bootstrapping.

val max_young_wosize : int

Maximal size of arrays that are directly allocated in the minor heap

val stack_threshold : int

Size in words of safe area at bottom of VM stack, see runtime/caml/config.h

val stack_safety_margin : int

Size in words of the safety margin between the bottom of the stack and the stack pointer. This margin can be used by intermediate computations of some instructions, or the event handler.

val architecture : string

Name of processor type for the native-code compiler

val model : string

Name of processor submodel for the native-code compiler

val system : string

Name of operating system for the native-code compiler

val asm : string

The assembler (and flags) to use for assembling ocamlopt-generated code.

val asm_cfi_supported : bool

Whether assembler understands CFI directives

val with_frame_pointers : bool

Whether assembler should maintain frame pointers

val ext_obj : string

Extension for object files, e.g. .o under Unix.

val ext_asm : string

Extension for assembler files, e.g. .s under Unix.

val ext_lib : string

Extension for library files, e.g. .a under Unix.

val ext_dll : string

Extension for dynamically-loaded libraries, e.g. .so under Unix.

val ext_exe : string

Extension for executable programs, e.g. .exe under Windows.

  • since 4.12.0
val default_executable_name : string

Name of executable produced by linking if none is given with -o, e.g. a.out under Unix.

val systhread_supported : bool

Whether the system thread library is implemented

val flexdll_dirs : string list

Directories needed for the FlexDLL objects

val host : string

Whether the compiler is a cross-compiler

val target : string

Whether the compiler is a cross-compiler

val flambda : bool

Whether the compiler was configured for flambda

val with_flambda_invariants : bool

Whether the invariants checks for flambda are enabled

val with_cmm_invariants : bool

Whether the invariants checks for Cmm are enabled

val profinfo : bool

Whether the compiler was configured for profiling

val profinfo_width : int

How many bits are to be used in values' headers for profiling information

val flat_float_array : bool

Whether the compiler and runtime automagically flatten float arrays

val function_sections : bool

Whether the compiler was configured to generate each function in a separate section

val windows_unicode : bool

Whether Windows Unicode runtime is enabled

val naked_pointers : bool

Whether the runtime supports naked pointers

  • since 4.14.0
val supports_shared_libraries : bool

Whether shared libraries are supported

  • since 4.08.0
val afl_instrument : bool

Whether afl-fuzz instrumentation is generated by default

val print_config : out_channel -> unit

Access to configuration values

val config_var : string -> string option

the configuration value of a variable, if it exists

+Config_boot (ocaml.Config_boot)

Module Config_boot

System configuration

Warning: this module is unstable and part of compiler-libs.

val version : string

The current version number of the system

val bindir : string

The directory containing the binary programs

val standard_library : string

The directory containing the standard libraries

val ccomp_type : string

The "kind" of the C compiler, assembler and linker used: one of "cc" (for Unix-style C compilers) "msvc" (for Microsoft Visual C++ and MASM)

val c_compiler : string

The compiler to use for compiling C files

val c_output_obj : string

Name of the option of the C compiler for specifying the output file

val c_has_debug_prefix_map : bool

Whether the C compiler supports -fdebug-prefix-map

val as_has_debug_prefix_map : bool

Whether the assembler supports --debug-prefix-map

val ocamlc_cflags : string

The flags ocamlc should pass to the C compiler

val ocamlc_cppflags : string

The flags ocamlc should pass to the C preprocessor

val ocamlopt_cflags : string
  • deprecated

    ocamlc_cflags should be used instead. The flags ocamlopt should pass to the C compiler

val ocamlopt_cppflags : string
  • deprecated

    ocamlc_cppflags should be used instead. The flags ocamlopt should pass to the C preprocessor

val bytecomp_c_libraries : string

The C libraries to link with custom runtimes

val native_c_libraries : string

The C libraries to link with native-code programs

val native_pack_linker : string

The linker to use for packaging (ocamlopt -pack) and for partial links (ocamlopt -output-obj).

val mkdll : string

The linker command line to build dynamic libraries.

val mkexe : string

The linker command line to build executables.

val mkmaindll : string

The linker command line to build main programs as dlls.

val default_rpath : string

Option to add a directory to be searched for libraries at runtime (used by ocamlmklib)

val mksharedlibrpath : string

Option to add a directory to be searched for shared libraries at runtime (used by ocamlmklib)

val ar : string

Name of the ar command, or "" if not needed (MSVC)

val interface_suffix : string Stdlib.ref

Suffix for interface file names

val exec_magic_number : string

Magic number for bytecode executable files

val cmi_magic_number : string

Magic number for compiled interface files

val cmo_magic_number : string

Magic number for object bytecode files

val cma_magic_number : string

Magic number for archive files

val cmx_magic_number : string

Magic number for compilation unit descriptions

val cmxa_magic_number : string

Magic number for libraries of compilation unit descriptions

val ast_intf_magic_number : string

Magic number for file holding an interface syntax tree

val ast_impl_magic_number : string

Magic number for file holding an implementation syntax tree

val cmxs_magic_number : string

Magic number for dynamically-loadable plugins

val cmt_magic_number : string

Magic number for compiled interface files

val linear_magic_number : string

Magic number for Linear internal representation files

val max_tag : int

Biggest tag that can be stored in the header of a regular block.

val lazy_tag : int

Normally the same as Obj.lazy_tag. Separate definition because of technical reasons for bootstrapping.

val max_young_wosize : int

Maximal size of arrays that are directly allocated in the minor heap

val stack_threshold : int

Size in words of safe area at bottom of VM stack, see runtime/caml/config.h

val stack_safety_margin : int

Size in words of the safety margin between the bottom of the stack and the stack pointer. This margin can be used by intermediate computations of some instructions, or the event handler.

val architecture : string

Name of processor type for the native-code compiler

val model : string

Name of processor submodel for the native-code compiler

val system : string

Name of operating system for the native-code compiler

val asm : string

The assembler (and flags) to use for assembling ocamlopt-generated code.

val asm_cfi_supported : bool

Whether assembler understands CFI directives

val with_frame_pointers : bool

Whether assembler should maintain frame pointers

val ext_obj : string

Extension for object files, e.g. .o under Unix.

val ext_asm : string

Extension for assembler files, e.g. .s under Unix.

val ext_lib : string

Extension for library files, e.g. .a under Unix.

val ext_dll : string

Extension for dynamically-loaded libraries, e.g. .so under Unix.

val ext_exe : string

Extension for executable programs, e.g. .exe under Windows.

  • since 4.12.0
val default_executable_name : string

Name of executable produced by linking if none is given with -o, e.g. a.out under Unix.

val systhread_supported : bool

Whether the system thread library is implemented

val flexdll_dirs : string list

Directories needed for the FlexDLL objects

val host : string

Whether the compiler is a cross-compiler

val target : string

Whether the compiler is a cross-compiler

val flambda : bool

Whether the compiler was configured for flambda

val with_flambda_invariants : bool

Whether the invariants checks for flambda are enabled

val with_cmm_invariants : bool

Whether the invariants checks for Cmm are enabled

val profinfo : bool

Whether the compiler was configured for profiling

val profinfo_width : int

How many bits are to be used in values' headers for profiling information

val flat_float_array : bool

Whether the compiler and runtime automagically flatten float arrays

val function_sections : bool

Whether the compiler was configured to generate each function in a separate section

val windows_unicode : bool

Whether Windows Unicode runtime is enabled

val naked_pointers : bool

Whether the runtime supports naked pointers

  • since 4.14.0
val supports_shared_libraries : bool

Whether shared libraries are supported

  • since 4.08.0
val afl_instrument : bool

Whether afl-fuzz instrumentation is generated by default

val print_config : Stdlib.out_channel -> unit

Access to configuration values

val config_var : string -> string option

the configuration value of a variable, if it exists

diff --git a/dev/ocaml/Config_main/index.html b/dev/ocaml/Config_main/index.html index 628c9371..7567acc2 100644 --- a/dev/ocaml/Config_main/index.html +++ b/dev/ocaml/Config_main/index.html @@ -1,2 +1,2 @@ -Config_main (ocaml.Config_main)

Module Config_main

System configuration

Warning: this module is unstable and part of compiler-libs.

val version : string

The current version number of the system

val bindir : string

The directory containing the binary programs

val standard_library : string

The directory containing the standard libraries

val ccomp_type : string

The "kind" of the C compiler, assembler and linker used: one of "cc" (for Unix-style C compilers) "msvc" (for Microsoft Visual C++ and MASM)

val c_compiler : string

The compiler to use for compiling C files

val c_output_obj : string

Name of the option of the C compiler for specifying the output file

val c_has_debug_prefix_map : bool

Whether the C compiler supports -fdebug-prefix-map

val as_has_debug_prefix_map : bool

Whether the assembler supports --debug-prefix-map

val ocamlc_cflags : string

The flags ocamlc should pass to the C compiler

val ocamlc_cppflags : string

The flags ocamlc should pass to the C preprocessor

val ocamlopt_cflags : string
  • deprecated

    ocamlc_cflags should be used instead. The flags ocamlopt should pass to the C compiler

val ocamlopt_cppflags : string
  • deprecated

    ocamlc_cppflags should be used instead. The flags ocamlopt should pass to the C preprocessor

val bytecomp_c_libraries : string

The C libraries to link with custom runtimes

val native_c_libraries : string

The C libraries to link with native-code programs

val native_pack_linker : string

The linker to use for packaging (ocamlopt -pack) and for partial links (ocamlopt -output-obj).

val mkdll : string

The linker command line to build dynamic libraries.

val mkexe : string

The linker command line to build executables.

val mkmaindll : string

The linker command line to build main programs as dlls.

val default_rpath : string

Option to add a directory to be searched for libraries at runtime (used by ocamlmklib)

val mksharedlibrpath : string

Option to add a directory to be searched for shared libraries at runtime (used by ocamlmklib)

val ar : string

Name of the ar command, or "" if not needed (MSVC)

val interface_suffix : string ref

Suffix for interface file names

val exec_magic_number : string

Magic number for bytecode executable files

val cmi_magic_number : string

Magic number for compiled interface files

val cmo_magic_number : string

Magic number for object bytecode files

val cma_magic_number : string

Magic number for archive files

val cmx_magic_number : string

Magic number for compilation unit descriptions

val cmxa_magic_number : string

Magic number for libraries of compilation unit descriptions

val ast_intf_magic_number : string

Magic number for file holding an interface syntax tree

val ast_impl_magic_number : string

Magic number for file holding an implementation syntax tree

val cmxs_magic_number : string

Magic number for dynamically-loadable plugins

val cmt_magic_number : string

Magic number for compiled interface files

val linear_magic_number : string

Magic number for Linear internal representation files

val max_tag : int

Biggest tag that can be stored in the header of a regular block.

val lazy_tag : int

Normally the same as Obj.lazy_tag. Separate definition because of technical reasons for bootstrapping.

val max_young_wosize : int

Maximal size of arrays that are directly allocated in the minor heap

val stack_threshold : int

Size in words of safe area at bottom of VM stack, see runtime/caml/config.h

val stack_safety_margin : int

Size in words of the safety margin between the bottom of the stack and the stack pointer. This margin can be used by intermediate computations of some instructions, or the event handler.

val architecture : string

Name of processor type for the native-code compiler

val model : string

Name of processor submodel for the native-code compiler

val system : string

Name of operating system for the native-code compiler

val asm : string

The assembler (and flags) to use for assembling ocamlopt-generated code.

val asm_cfi_supported : bool

Whether assembler understands CFI directives

val with_frame_pointers : bool

Whether assembler should maintain frame pointers

val ext_obj : string

Extension for object files, e.g. .o under Unix.

val ext_asm : string

Extension for assembler files, e.g. .s under Unix.

val ext_lib : string

Extension for library files, e.g. .a under Unix.

val ext_dll : string

Extension for dynamically-loaded libraries, e.g. .so under Unix.

val ext_exe : string

Extension for executable programs, e.g. .exe under Windows.

  • since 4.12.0
val default_executable_name : string

Name of executable produced by linking if none is given with -o, e.g. a.out under Unix.

val systhread_supported : bool

Whether the system thread library is implemented

val flexdll_dirs : string list

Directories needed for the FlexDLL objects

val host : string

Whether the compiler is a cross-compiler

val target : string

Whether the compiler is a cross-compiler

val flambda : bool

Whether the compiler was configured for flambda

val with_flambda_invariants : bool

Whether the invariants checks for flambda are enabled

val with_cmm_invariants : bool

Whether the invariants checks for Cmm are enabled

val profinfo : bool

Whether the compiler was configured for profiling

val profinfo_width : int

How many bits are to be used in values' headers for profiling information

val flat_float_array : bool

Whether the compiler and runtime automagically flatten float arrays

val function_sections : bool

Whether the compiler was configured to generate each function in a separate section

val windows_unicode : bool

Whether Windows Unicode runtime is enabled

val naked_pointers : bool

Whether the runtime supports naked pointers

  • since 4.14.0
val supports_shared_libraries : bool

Whether shared libraries are supported

  • since 4.08.0
val afl_instrument : bool

Whether afl-fuzz instrumentation is generated by default

val print_config : out_channel -> unit

Access to configuration values

val config_var : string -> string option

the configuration value of a variable, if it exists

+Config_main (ocaml.Config_main)

Module Config_main

System configuration

Warning: this module is unstable and part of compiler-libs.

val version : string

The current version number of the system

val bindir : string

The directory containing the binary programs

val standard_library : string

The directory containing the standard libraries

val ccomp_type : string

The "kind" of the C compiler, assembler and linker used: one of "cc" (for Unix-style C compilers) "msvc" (for Microsoft Visual C++ and MASM)

val c_compiler : string

The compiler to use for compiling C files

val c_output_obj : string

Name of the option of the C compiler for specifying the output file

val c_has_debug_prefix_map : bool

Whether the C compiler supports -fdebug-prefix-map

val as_has_debug_prefix_map : bool

Whether the assembler supports --debug-prefix-map

val ocamlc_cflags : string

The flags ocamlc should pass to the C compiler

val ocamlc_cppflags : string

The flags ocamlc should pass to the C preprocessor

val ocamlopt_cflags : string
  • deprecated

    ocamlc_cflags should be used instead. The flags ocamlopt should pass to the C compiler

val ocamlopt_cppflags : string
  • deprecated

    ocamlc_cppflags should be used instead. The flags ocamlopt should pass to the C preprocessor

val bytecomp_c_libraries : string

The C libraries to link with custom runtimes

val native_c_libraries : string

The C libraries to link with native-code programs

val native_pack_linker : string

The linker to use for packaging (ocamlopt -pack) and for partial links (ocamlopt -output-obj).

val mkdll : string

The linker command line to build dynamic libraries.

val mkexe : string

The linker command line to build executables.

val mkmaindll : string

The linker command line to build main programs as dlls.

val default_rpath : string

Option to add a directory to be searched for libraries at runtime (used by ocamlmklib)

val mksharedlibrpath : string

Option to add a directory to be searched for shared libraries at runtime (used by ocamlmklib)

val ar : string

Name of the ar command, or "" if not needed (MSVC)

val interface_suffix : string Stdlib.ref

Suffix for interface file names

val exec_magic_number : string

Magic number for bytecode executable files

val cmi_magic_number : string

Magic number for compiled interface files

val cmo_magic_number : string

Magic number for object bytecode files

val cma_magic_number : string

Magic number for archive files

val cmx_magic_number : string

Magic number for compilation unit descriptions

val cmxa_magic_number : string

Magic number for libraries of compilation unit descriptions

val ast_intf_magic_number : string

Magic number for file holding an interface syntax tree

val ast_impl_magic_number : string

Magic number for file holding an implementation syntax tree

val cmxs_magic_number : string

Magic number for dynamically-loadable plugins

val cmt_magic_number : string

Magic number for compiled interface files

val linear_magic_number : string

Magic number for Linear internal representation files

val max_tag : int

Biggest tag that can be stored in the header of a regular block.

val lazy_tag : int

Normally the same as Obj.lazy_tag. Separate definition because of technical reasons for bootstrapping.

val max_young_wosize : int

Maximal size of arrays that are directly allocated in the minor heap

val stack_threshold : int

Size in words of safe area at bottom of VM stack, see runtime/caml/config.h

val stack_safety_margin : int

Size in words of the safety margin between the bottom of the stack and the stack pointer. This margin can be used by intermediate computations of some instructions, or the event handler.

val architecture : string

Name of processor type for the native-code compiler

val model : string

Name of processor submodel for the native-code compiler

val system : string

Name of operating system for the native-code compiler

val asm : string

The assembler (and flags) to use for assembling ocamlopt-generated code.

val asm_cfi_supported : bool

Whether assembler understands CFI directives

val with_frame_pointers : bool

Whether assembler should maintain frame pointers

val ext_obj : string

Extension for object files, e.g. .o under Unix.

val ext_asm : string

Extension for assembler files, e.g. .s under Unix.

val ext_lib : string

Extension for library files, e.g. .a under Unix.

val ext_dll : string

Extension for dynamically-loaded libraries, e.g. .so under Unix.

val ext_exe : string

Extension for executable programs, e.g. .exe under Windows.

  • since 4.12.0
val default_executable_name : string

Name of executable produced by linking if none is given with -o, e.g. a.out under Unix.

val systhread_supported : bool

Whether the system thread library is implemented

val flexdll_dirs : string list

Directories needed for the FlexDLL objects

val host : string

Whether the compiler is a cross-compiler

val target : string

Whether the compiler is a cross-compiler

val flambda : bool

Whether the compiler was configured for flambda

val with_flambda_invariants : bool

Whether the invariants checks for flambda are enabled

val with_cmm_invariants : bool

Whether the invariants checks for Cmm are enabled

val profinfo : bool

Whether the compiler was configured for profiling

val profinfo_width : int

How many bits are to be used in values' headers for profiling information

val flat_float_array : bool

Whether the compiler and runtime automagically flatten float arrays

val function_sections : bool

Whether the compiler was configured to generate each function in a separate section

val windows_unicode : bool

Whether Windows Unicode runtime is enabled

val naked_pointers : bool

Whether the runtime supports naked pointers

  • since 4.14.0
val supports_shared_libraries : bool

Whether shared libraries are supported

  • since 4.08.0
val afl_instrument : bool

Whether afl-fuzz instrumentation is generated by default

val print_config : Stdlib.out_channel -> unit

Access to configuration values

val config_var : string -> string option

the configuration value of a variable, if it exists

diff --git a/dev/ocaml/Local_store/index.html b/dev/ocaml/Local_store/index.html index 11dacb1b..bfb9cdcd 100644 --- a/dev/ocaml/Local_store/index.html +++ b/dev/ocaml/Local_store/index.html @@ -1,2 +1,2 @@ -Local_store (ocaml.Local_store)

Module Local_store

This module provides some facilities for creating references (and hash tables) which can easily be snapshoted and restored to an arbitrary version.

It is used throughout the frontend (read: typechecker), to register all (well, hopefully) the global state. Thus making it easy for tools like Merlin to go back and forth typechecking different files.

Creators

val s_ref : 'a -> 'a ref

Similar to Stdlib.ref, except the allocated reference is registered into the store.

val s_table : ('a -> 'b) -> 'a -> 'b ref

Used to register hash tables. Those also need to be placed into refs to be easily swapped out, but one can't just "snapshot" the initial value to create fresh instances, so instead an initializer is required.

Use it like this:

let my_table = s_table Hashtbl.create 42

State management

Note: all the following functions are currently unused inside the compiler codebase. Merlin is their only user at the moment.

type store
val fresh : unit -> store

Returns a fresh instance of the store.

The first time this function is called, it snapshots the value of all the registered references, later calls to fresh will return instances initialized to those values.

val with_store : store -> (unit -> 'a) -> 'a

with_store s f resets all the registered references to the value they have in s for the run of f. If f updates any of the registered refs, s is updated to remember those changes.

val reset : unit -> unit

Resets all the references to the initial snapshot (i.e. to the same values that new instances start with).

val is_bound : unit -> bool

Returns true when a store is active (i.e. when called from the callback passed to with_store), false otherwise.

+Local_store (ocaml.Local_store)

Module Local_store

This module provides some facilities for creating references (and hash tables) which can easily be snapshoted and restored to an arbitrary version.

It is used throughout the frontend (read: typechecker), to register all (well, hopefully) the global state. Thus making it easy for tools like Merlin to go back and forth typechecking different files.

Creators

val s_ref : 'a -> 'a Stdlib.ref

Similar to Stdlib.ref, except the allocated reference is registered into the store.

val s_table : ('a -> 'b) -> 'a -> 'b Stdlib.ref

Used to register hash tables. Those also need to be placed into refs to be easily swapped out, but one can't just "snapshot" the initial value to create fresh instances, so instead an initializer is required.

Use it like this:

let my_table = s_table Hashtbl.create 42

State management

Note: all the following functions are currently unused inside the compiler codebase. Merlin is their only user at the moment.

type store
val fresh : unit -> store

Returns a fresh instance of the store.

The first time this function is called, it snapshots the value of all the registered references, later calls to fresh will return instances initialized to those values.

val with_store : store -> (unit -> 'a) -> 'a

with_store s f resets all the registered references to the value they have in s for the run of f. If f updates any of the registered refs, s is updated to remember those changes.

val reset : unit -> unit

Resets all the references to the initial snapshot (i.e. to the same values that new instances start with).

val is_bound : unit -> bool

Returns true when a store is active (i.e. when called from the callback passed to with_store), false otherwise.

diff --git a/dev/ocaml/Odoc_comments_global/index.html b/dev/ocaml/Odoc_comments_global/index.html index 85b0e93f..fcaed1a9 100644 --- a/dev/ocaml/Odoc_comments_global/index.html +++ b/dev/ocaml/Odoc_comments_global/index.html @@ -1,2 +1,2 @@ -Odoc_comments_global (ocaml.Odoc_comments_global)

Module Odoc_comments_global

val nb_chars : int ref
val authors : string list ref
val version : string option ref
val sees : string list ref
val since : string option ref
val before : (string * string) list ref
val deprecated : string option ref
val params : (string * string) list ref
val raised_exceptions : (string * string) list ref
val return_value : string option ref
val customs : (string * string) list ref
val init : unit -> unit
+Odoc_comments_global (ocaml.Odoc_comments_global)

Module Odoc_comments_global

val nb_chars : int Stdlib.ref
val authors : string list Stdlib.ref
val version : string option Stdlib.ref
val sees : string list Stdlib.ref
val since : string option Stdlib.ref
val before : (string * string) list Stdlib.ref
val deprecated : string option Stdlib.ref
val params : (string * string) list Stdlib.ref
val raised_exceptions : (string * string) list Stdlib.ref
val return_value : string option Stdlib.ref
val customs : (string * string) list Stdlib.ref
val init : unit -> unit
diff --git a/dev/ocaml/Odoc_config/index.html b/dev/ocaml/Odoc_config/index.html index 9d1a1673..170129ff 100644 --- a/dev/ocaml/Odoc_config/index.html +++ b/dev/ocaml/Odoc_config/index.html @@ -1,2 +1,2 @@ -Odoc_config (ocaml.Odoc_config)

Module Odoc_config

val custom_generators_path : string
val print_warnings : bool ref
+Odoc_config (ocaml.Odoc_config)

Module Odoc_config

val custom_generators_path : string
val print_warnings : bool Stdlib.ref
diff --git a/dev/ocaml/Profiling/index.html b/dev/ocaml/Profiling/index.html index 6c098de7..98ca321b 100644 --- a/dev/ocaml/Profiling/index.html +++ b/dev/ocaml/Profiling/index.html @@ -1,2 +1,2 @@ -Profiling (ocaml.Profiling)

Module Profiling

val counters : (string * (string * int array)) list ref
val incr : int array -> int -> unit
+Profiling (ocaml.Profiling)

Module Profiling

val counters : (string * (string * int array)) list Stdlib.ref
val incr : int array -> int -> unit
diff --git a/dev/ocaml/Terminfo/index.html b/dev/ocaml/Terminfo/index.html index 2d798fad..842aceb2 100644 --- a/dev/ocaml/Terminfo/index.html +++ b/dev/ocaml/Terminfo/index.html @@ -1,2 +1,2 @@ -Terminfo (ocaml.Terminfo)

Module Terminfo

Basic interface to the terminfo database

Warning: this module is unstable and part of compiler-libs.

type status =
  1. | Uninitialised
  2. | Bad_term
  3. | Good_term
val setup : out_channel -> status
val num_lines : out_channel -> int
val backup : out_channel -> int -> unit
val standout : out_channel -> bool -> unit
val resume : out_channel -> int -> unit
+Terminfo (ocaml.Terminfo)

Module Terminfo

Basic interface to the terminfo database

Warning: this module is unstable and part of compiler-libs.

type status =
  1. | Uninitialised
  2. | Bad_term
  3. | Good_term
val setup : Stdlib.out_channel -> status
val num_lines : Stdlib.out_channel -> int
val backup : Stdlib.out_channel -> int -> unit
val standout : Stdlib.out_channel -> bool -> unit
val resume : Stdlib.out_channel -> int -> unit
diff --git a/dev/ocaml/X86_gas/index.html b/dev/ocaml/X86_gas/index.html index b5117a92..0efd3e2e 100644 --- a/dev/ocaml/X86_gas/index.html +++ b/dev/ocaml/X86_gas/index.html @@ -1,2 +1,2 @@ -X86_gas (ocaml.X86_gas)

Module X86_gas

Emit assembly instructions for gas.

val generate_asm : out_channel -> X86_ast.asm_line list -> unit
+X86_gas (ocaml.X86_gas)

Module X86_gas

Emit assembly instructions for gas.

val generate_asm : Stdlib.out_channel -> X86_ast.asm_line list -> unit
diff --git a/dev/ocaml/X86_masm/index.html b/dev/ocaml/X86_masm/index.html index 80c7a124..692bb1e7 100644 --- a/dev/ocaml/X86_masm/index.html +++ b/dev/ocaml/X86_masm/index.html @@ -1,2 +1,2 @@ -X86_masm (ocaml.X86_masm)

Module X86_masm

Emit assembly instructions for MASM (Intel syntax).

val generate_asm : out_channel -> X86_ast.asm_line list -> unit
+X86_masm (ocaml.X86_masm)

Module X86_masm

Emit assembly instructions for MASM (Intel syntax).

val generate_asm : Stdlib.out_channel -> X86_ast.asm_line list -> unit