File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
collector/benchmarks/ctfe-stress/src Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 4
4
// And without support for loops.
5
5
6
6
macro_rules! const_repeat {
7
- // Base case: Use 16 at the end to avoid function calls at the leaves as much as possibele .
7
+ // Base case: Use 16 at the end to avoid function calls at the leafs as much as possible .
8
8
( [ 16 ] $e: expr, $T: ty) => { {
9
9
$e; $e; $e; $e;
10
10
$e; $e; $e; $e;
@@ -60,3 +60,8 @@ expensive_static!(OPS: i32 = ((((10 >> 1) + 3) * 7) / 2 - 12) << 4; [4 16 16 16
60
60
expensive_static ! ( RELOCATIONS : & ' static str = "hello" ; [ 8 16 16 16 16 ] ) ;
61
61
expensive_static ! ( UNSIZE_SLICE : & ' static [ u8 ] = b"foo" ; [ 4 16 16 16 16 16 ] ) ;
62
62
expensive_static ! ( UNSIZE_TRAIT : & ' static Trait = & 42u32 ; [ 4 16 16 16 16 16 ] ) ;
63
+
64
+ // copying all these zeros and the corresponding definedness bits can be expensive and is probably
65
+ // prone to regressions.
66
+ // 24 is an exponent that makes the repeat expression take less than two seconds to compute
67
+ const FOO : [ i32 ; 1 << 24 ] = [ 0 ; 1 << 24 ] ;
You can’t perform that action at this time.
0 commit comments