/src/rust-brotli/src/enc/block_split.rs
Line | Count | Source |
1 | | use super::super::alloc; |
2 | | use super::super::alloc::{Allocator, SliceWrapper}; |
3 | | use crate::enc::combined_alloc::alloc_default; |
4 | | |
5 | | pub struct BlockSplit<Alloc: alloc::Allocator<u8> + alloc::Allocator<u32>> { |
6 | | pub num_types: usize, |
7 | | pub num_blocks: usize, |
8 | | pub types: <Alloc as Allocator<u8>>::AllocatedMemory, |
9 | | pub lengths: <Alloc as Allocator<u32>>::AllocatedMemory, |
10 | | } |
11 | | |
12 | | impl<Alloc: alloc::Allocator<u8> + alloc::Allocator<u32>> Default for BlockSplit<Alloc> { |
13 | 32.1k | fn default() -> Self { |
14 | 32.1k | Self { |
15 | 32.1k | num_types: 0, |
16 | 32.1k | num_blocks: 0, |
17 | 32.1k | types: alloc_default::<u8, Alloc>(), |
18 | 32.1k | lengths: alloc_default::<u32, Alloc>(), |
19 | 32.1k | } |
20 | 32.1k | } <brotli::enc::block_split::BlockSplit<alloc_stdlib::std_alloc::StandardAlloc> as core::default::Default>::default Line | Count | Source | 13 | 32.1k | fn default() -> Self { | 14 | 32.1k | Self { | 15 | 32.1k | num_types: 0, | 16 | 32.1k | num_blocks: 0, | 17 | 32.1k | types: alloc_default::<u8, Alloc>(), | 18 | 32.1k | lengths: alloc_default::<u32, Alloc>(), | 19 | 32.1k | } | 20 | 32.1k | } |
Unexecuted instantiation: <brotli::enc::block_split::BlockSplit<_> as core::default::Default>::default |
21 | | } |
22 | | |
23 | | impl<Alloc: alloc::Allocator<u8> + alloc::Allocator<u32>> BlockSplit<Alloc> { |
24 | 0 | pub fn new() -> BlockSplit<Alloc> { |
25 | 0 | Self::default() |
26 | 0 | } |
27 | 32.1k | pub fn destroy(&mut self, m: &mut Alloc) { |
28 | 32.1k | <Alloc as Allocator<u8>>::free_cell(m, core::mem::take(&mut self.types)); |
29 | 32.1k | <Alloc as Allocator<u32>>::free_cell(m, core::mem::take(&mut self.lengths)); |
30 | 32.1k | self.num_blocks = 0; |
31 | 32.1k | self.num_types = 0; |
32 | 32.1k | } <brotli::enc::block_split::BlockSplit<alloc_stdlib::std_alloc::StandardAlloc>>::destroy Line | Count | Source | 27 | 32.1k | pub fn destroy(&mut self, m: &mut Alloc) { | 28 | 32.1k | <Alloc as Allocator<u8>>::free_cell(m, core::mem::take(&mut self.types)); | 29 | 32.1k | <Alloc as Allocator<u32>>::free_cell(m, core::mem::take(&mut self.lengths)); | 30 | 32.1k | self.num_blocks = 0; | 31 | 32.1k | self.num_types = 0; | 32 | 32.1k | } |
Unexecuted instantiation: <brotli::enc::block_split::BlockSplit<_>>::destroy |
33 | 76.5k | pub fn types_alloc_size(&self) -> usize { |
34 | 76.5k | self.types.slice().len() |
35 | 76.5k | } <brotli::enc::block_split::BlockSplit<alloc_stdlib::std_alloc::StandardAlloc>>::types_alloc_size Line | Count | Source | 33 | 76.5k | pub fn types_alloc_size(&self) -> usize { | 34 | 76.5k | self.types.slice().len() | 35 | 76.5k | } |
Unexecuted instantiation: <brotli::enc::block_split::BlockSplit<_>>::types_alloc_size |
36 | 69.5k | pub fn lengths_alloc_size(&self) -> usize { |
37 | 69.5k | self.lengths.slice().len() |
38 | 69.5k | } <brotli::enc::block_split::BlockSplit<alloc_stdlib::std_alloc::StandardAlloc>>::lengths_alloc_size Line | Count | Source | 36 | 69.5k | pub fn lengths_alloc_size(&self) -> usize { | 37 | 69.5k | self.lengths.slice().len() | 38 | 69.5k | } |
Unexecuted instantiation: <brotli::enc::block_split::BlockSplit<_>>::lengths_alloc_size |
39 | | } |