@@ -34,7 +34,7 @@ use crate::converters::arrow_converter::{MasterBuilders, Slice2Arrow};
3434use crate :: converters:: self_converter:: SampleSliceAggregator ;
3535use crate :: converters:: Converter ;
3636use crate :: dump:: dump;
37- use crate :: slicers:: old_slicer:: { OldSlicer , IN_MAX_CHUNKS } ;
37+ use crate :: slicers:: old_slicer:: { OldSlicer , IN_MAX_CHUNKS , SLICER_IN_CHUNK_SIZE } ;
3838use crate :: slicers:: Slicer ;
3939use crate :: slicers:: { find_last_nl, line_break_len_cr, ChunkAndResidue } ;
4040use crate :: { error, mocker, schema} ;
@@ -140,11 +140,11 @@ enum Commands {
140140impl Cli {
141141 pub fn run < ' a > (
142142 & self ,
143- in_buffers : & mut [ ChunkAndResidue ; IN_MAX_CHUNKS ] ,
144143 ) -> Result < ( ) > {
145144 let n_logical_threads = num_cpus:: get ( ) ;
146145 let mut n_threads: usize = self . n_threads as usize ;
147146
147+
148148 if n_threads > n_logical_threads {
149149 info ! (
150150 "you specified to use {} thread, but your CPU only has {} logical threads" ,
@@ -153,6 +153,8 @@ impl Cli {
153153 n_threads = n_logical_threads;
154154 }
155155
156+ // Effektiv med fixa buffrar men fult att allokeringen ligger här ...känns banalt.
157+
156158 let multithreaded: bool = n_threads > 1 ;
157159 if multithreaded {
158160 info ! ( "multithreading enabled ({} logical threads)" , n_threads) ;
@@ -197,6 +199,8 @@ impl Cli {
197199 in_file,
198200 out_file,
199201 } ) => {
202+
203+
200204 let _in_file = fs:: File :: open ( & in_file) . expect ( "bbb" ) ;
201205
202206 let mut slicer_instance: Box < dyn Slicer > = Box :: new ( OldSlicer {
@@ -254,7 +258,6 @@ impl Cli {
254258
255259 let r = slicer_instance. slice_and_convert (
256260 converter_instance,
257- in_buffers,
258261 _in_file,
259262 n_threads as usize ,
260263 ) ;
0 commit comments