@@ -9,24 +9,24 @@ const FANOUT_FILE: &str = "fanout.cache";
99const OUTPUT_WIRES_FILE : & str = "outputs.cache" ;
1010
1111/// Try to load cached fanout and output wires from files
12- pub fn try_load_cache ( ) -> Option < ( Vec < u16 > , Vec < WireId > ) > {
12+ pub fn try_load_cache ( ) -> Option < ( Vec < u32 > , Vec < WireId > ) > {
1313 let fanout = load_fanout ( ) ?;
1414 let output_wires = load_output_wires ( ) ?;
1515 Some ( ( fanout, output_wires) )
1616}
1717
1818/// Load fanout from cache file
19- fn load_fanout ( ) -> Option < Vec < u16 > > {
19+ fn load_fanout ( ) -> Option < Vec < u32 > > {
2020 let file = OpenOptions :: new ( ) . read ( true ) . open ( FANOUT_FILE ) . ok ( ) ?;
2121 let mut reader = BufReader :: new ( file) ;
2222 let mut fanout = Vec :: new ( ) ;
2323
2424 loop {
25- let mut buf = [ 0u8 ; 2 ] ;
25+ let mut buf = [ 0u8 ; 4 ] ;
2626 if reader. read_exact ( & mut buf) . is_err ( ) {
2727 break ;
2828 }
29- fanout. push ( u16 :: from_le_bytes ( buf) ) ;
29+ fanout. push ( u32 :: from_le_bytes ( buf) ) ;
3030 }
3131
3232 Some ( fanout)
@@ -50,7 +50,7 @@ fn load_output_wires() -> Option<Vec<WireId>> {
5050}
5151
5252/// Save fanout to cache file
53- pub fn save_fanout ( fanout : & [ u16 ] ) -> std:: io:: Result < ( ) > {
53+ pub fn save_fanout ( fanout : & [ u32 ] ) -> std:: io:: Result < ( ) > {
5454 let file = OpenOptions :: new ( )
5555 . write ( true )
5656 . create ( true )
@@ -82,7 +82,7 @@ pub fn save_output_wires(output_wires: &[WireId]) -> std::io::Result<()> {
8282}
8383
8484/// Save both credits and output wires to cache files
85- pub fn save_cache ( credits : & [ u16 ] , output_wires : & [ WireId ] ) -> std:: io:: Result < ( ) > {
85+ pub fn save_cache ( credits : & [ u32 ] , output_wires : & [ WireId ] ) -> std:: io:: Result < ( ) > {
8686 save_fanout ( credits) ?;
8787 save_output_wires ( output_wires) ?;
8888 Ok ( ( ) )
0 commit comments