File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -252,9 +252,12 @@ where
252252 for ( i, iters) in iters. iter ( ) . enumerate ( ) {
253253 #[ cfg( any( target_family = "unix" , target_family = "windows" ) ) ]
254254 {
255+ // Intentionally vary the stack allocation size to reduce measurement bias from
256+ // memory alignment and cache effects.
257+ // The shift can go up to a full page size suitable for the system.
255258 alloca:: with_alloca (
256- i % page_size:: get ( ) , /* how much bytes we want to allocate */
257- |_shifting_stack_space : & mut [ core:: mem:: MaybeUninit < u8 > ] /* dynamically stack allocated slice itself */ | {
259+ i % page_size:: get ( ) , /* how many bytes we want to allocate */
260+ |_shifting_stack_space : & mut [ core:: mem:: MaybeUninit < u8 > ] /* stack allocated slice itself */ | {
258261 b. iters = * iters;
259262 ( * f) ( & mut b, black_box ( parameter) ) ;
260263 b. assert_iterated ( ) ;
You can’t perform that action at this time.
0 commit comments