From 33c7c24dfd78742ca0b4cf329ca2773af9dd144e Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Fri, 11 Nov 2022 11:11:38 +0100 Subject: [PATCH] code cleanups (removed profile release from dune-workspace to find some warnings) --- memory_pressure.ml | 15 --------------- my_dns.ml | 1 - my_nat.ml | 2 -- uplink.mli | 1 - 4 files changed, 19 deletions(-) diff --git a/memory_pressure.ml b/memory_pressure.ml index 629ecda..2e9e95a 100644 --- a/memory_pressure.ml +++ b/memory_pressure.ml @@ -36,21 +36,6 @@ let report_mem_usage stats = ) ) -let print_mem_usage = - let rec aux () = - let stats = Xen_os.Memory.quick_stat () in - let { Xen_os.Memory.free_words; heap_words; _ } = stats in - let mem_total = heap_words * wordsize_in_bytes in - let mem_free = free_words * wordsize_in_bytes in - Log.info (fun f -> f "Memory usage: free %a / %a (%.2f %%)" - Fmt.bi_byte_size mem_free - Fmt.bi_byte_size mem_total - (fraction_free stats *. 100.0)); - Xen_os.Time.sleep_ns (Duration.of_f 600.0) >>= fun () -> - aux () - in - aux () - let init () = Gc.full_major (); let stats = Xen_os.Memory.quick_stat () in diff --git a/my_dns.ml b/my_dns.ml index 35fbb8d..9f3c877 100644 --- a/my_dns.ml +++ b/my_dns.ml @@ -32,7 +32,6 @@ module Transport (R : Mirage_random.S) (C : Mirage_clock.MCLOCK) (Time : Mirage_ let send_recv (ctx : context) buf : (Cstruct.t, [> `Msg of string ]) result Lwt.t = let open Router in - let open My_nat in let dst, dst_port = ctx.nameserver in let router, send_udp, answer = ctx.stack in let src_port, evict = diff --git a/my_nat.ml b/my_nat.ml index 209a562..17b3a59 100644 --- a/my_nat.ml +++ b/my_nat.ml @@ -1,8 +1,6 @@ (* Copyright (C) 2015, Thomas Leonard See the README file for details. *) -open Lwt.Infix - let src = Logs.Src.create "my-nat" ~doc:"NAT shim" module Log = (val Logs.src_log src : Logs.LOG) diff --git a/uplink.mli b/uplink.mli index 0052d75..f6edaaf 100644 --- a/uplink.mli +++ b/uplink.mli @@ -5,7 +5,6 @@ open Fw_utils -[@@@ocaml.warning "-67"] module Make (R: Mirage_random.S)(Clock : Mirage_clock.MCLOCK)(Time : Mirage_time.S) : sig type t