Skip to content

Commit e61ce6a

Browse files
committed
prevent large table stack copies in debug mode
(see #24 for background)
1 parent 761186e commit e61ce6a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/table.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
pub const CRC32_TABLE: [[u32; 256]; 16] = [
1+
// NOTE: This is static instead of const to ensure that indexing into this table
2+
// doesn't result in large memmoves when in debug mode, which can significantly
3+
// impact performance.
4+
pub static CRC32_TABLE: [[u32; 256]; 16] = [
25
[
36
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535,
47
0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd,

0 commit comments

Comments
 (0)