1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950(*
* BatGC - Extended GC operations
* Copyright (C) 1996 Damien Doligez
* 2008 David Teller, LIFO, Universite d'Orleans
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version,
* with the special exception on linking described in file LICENSE.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*)openBatPrintfincludeGcletprint_statc=(* copied fromoriginal module *)letst=stat()infprintfc"minor_collections: %d\n"st.minor_collections;fprintfc"major_collections: %d\n"st.major_collections;fprintfc"compactions: %d\n"st.compactions;fprintfc"\n";letl1=String.length(sprintf "%.0f"st.minor_words)infprintfc"minor_words: %*.0f\n"l1st.minor_words;fprintfc"promoted_words:%*.0f\n"l1st.promoted_words;fprintfc"major_words: %*.0f\n"l1st.major_words;fprintfc"\n";letl2=String.length(sprintf "%d"st.top_heap_words)infprintfc"top_heap_words:%*d\n"l2st.top_heap_words;fprintfc"heap_words: %*d\n"l2st.heap_words;fprintf c"live_words: %*d\n"l2st.live_words;fprintf c"free_words: %*d\n"l2st.free_words;fprintf c"largest_free: %*d\n"l2st.largest_free;fprintfc"fragments: %*d\n"l2st.fragments;fprintfc"\n";fprintfc"live_blocks: %d\n"st.live_blocks;fprintfc"free_blocks: %d\n"st.free_blocks;fprintfc"heap_chunks: %d\n"st.heap_chunks(*$T print_stat
(IO.output_string () |> tap print_stat |> IO.close_out |> String.split_on_string ~by:"\n" |> List.length) = 19
*)