File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,6 @@ impl Tables {
62
62
}
63
63
let mut table16 = [ 0 , ..1 << 16 ] ;
64
64
for ( i, v) in table16. iter_mut ( ) . enumerate ( ) {
65
- // assume little endian
66
65
* v = table8[ i & 255 ] as u16 << 8 |
67
66
table8[ i >> 8 ] as u16 ;
68
67
}
@@ -104,9 +103,10 @@ impl Tables {
104
103
105
104
/// Reads all remaining bytes from the stream.
106
105
fn read_to_end < R : Reader > ( r : & mut R ) -> IoResult < Vec < u8 > > {
107
- // FIXME: this method is a temporary workaround for jemalloc on
108
- // linux. Replace it with Reader::read_to_end() once the jemalloc
109
- // issue has been fixed.
106
+ // As reading the input stream in memory is a bottleneck, we tune
107
+ // Reader::read_to_end() with a fast growing policy to limit
108
+ // recopies. If MREMAP_RETAIN is implemented in the linux kernel
109
+ // and jemalloc use it, this trick will become useless.
110
110
const CHUNK : uint = 64 * 1024 ;
111
111
112
112
let mut vec = Vec :: with_capacity ( CHUNK ) ;
You can’t perform that action at this time.
0 commit comments