ligo/src/lib_stdlib/lwt_utils.mli
Pierre Chambart ce926e575a Teamwork: Prevent leaks with never_ending
Lwt_utils.never_ending is a global variable, hence a GC root. A promise
created by binding it cannot ever be garbage collected. This fixes the
known leak in the baker an endorser by allocating a fresh one for each
use (by turning it into a function). This porbably fix other slower
leaks.

High five Klakplok and Vincent.
2018-06-19 03:06:21 +02:00

26 lines
991 B
OCaml

(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
val may: f:('a -> unit Lwt.t) -> 'a option -> unit Lwt.t
val never_ending: unit -> 'a Lwt.t
val worker:
string ->
run:(unit -> unit Lwt.t) ->
cancel:(unit -> unit Lwt.t) ->
unit Lwt.t
val trigger: unit -> (unit -> unit) * (unit -> unit Lwt.t)
val sort: ('a -> 'a -> int Lwt.t) -> 'a list -> 'a list Lwt.t
val unless: bool -> (unit -> unit Lwt.t) -> unit Lwt.t