mirror of
https://github.com/mirage/qubes-mirage-firewall.git
synced 2025-01-14 16:47:12 -05:00
code cleanups (removed profile release from dune-workspace to find some warnings)
This commit is contained in:
parent
ecc5cbc409
commit
33c7c24dfd
@ -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 () =
|
let init () =
|
||||||
Gc.full_major ();
|
Gc.full_major ();
|
||||||
let stats = Xen_os.Memory.quick_stat () in
|
let stats = Xen_os.Memory.quick_stat () in
|
||||||
|
@ -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 send_recv (ctx : context) buf : (Cstruct.t, [> `Msg of string ]) result Lwt.t =
|
||||||
let open Router in
|
let open Router in
|
||||||
let open My_nat in
|
|
||||||
let dst, dst_port = ctx.nameserver in
|
let dst, dst_port = ctx.nameserver in
|
||||||
let router, send_udp, answer = ctx.stack in
|
let router, send_udp, answer = ctx.stack in
|
||||||
let src_port, evict =
|
let src_port, evict =
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
(* Copyright (C) 2015, Thomas Leonard <thomas.leonard@unikernel.com>
|
(* Copyright (C) 2015, Thomas Leonard <thomas.leonard@unikernel.com>
|
||||||
See the README file for details. *)
|
See the README file for details. *)
|
||||||
|
|
||||||
open Lwt.Infix
|
|
||||||
|
|
||||||
let src = Logs.Src.create "my-nat" ~doc:"NAT shim"
|
let src = Logs.Src.create "my-nat" ~doc:"NAT shim"
|
||||||
module Log = (val Logs.src_log src : Logs.LOG)
|
module Log = (val Logs.src_log src : Logs.LOG)
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
open Fw_utils
|
open Fw_utils
|
||||||
|
|
||||||
[@@@ocaml.warning "-67"]
|
|
||||||
module Make (R: Mirage_random.S)(Clock : Mirage_clock.MCLOCK)(Time : Mirage_time.S) : sig
|
module Make (R: Mirage_random.S)(Clock : Mirage_clock.MCLOCK)(Time : Mirage_time.S) : sig
|
||||||
type t
|
type t
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user