Skip to content

Commit 84459c0

Browse files
author
Alex Peck
committed
try without pad
1 parent 98ec2d8 commit 84459c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

BitFaster.Caching/Lfu/CmSketchCore.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ private void EnsureCapacity(long maximumSize)
125125

126126
#if NET6_0_OR_GREATER
127127
// over alloc by 4 to give 32 bytes padding, tableAddr is then aligned to 32 bytes
128-
const int buffer = 4;
129-
table = GC.AllocateArray<long>(Math.Max(BitOps.CeilingPowerOfTwo(maximum), 8) + buffer, true);
128+
const int pad = 4;
129+
table = GC.AllocateArray<long>(Math.Max(BitOps.CeilingPowerOfTwo(maximum), 8) + pad, true);
130130
long pointer = (long)Unsafe.AsPointer(ref table[0]);
131131
tableAddr = (long*)pointer + pointer % 32;
132-
blockMask = (int)((uint)(table.Length-buffer) >> 3) - 1;
132+
blockMask = (int)((uint)(table.Length-pad) >> 3) - 1;
133133
#else
134134
table = new long[Math.Max(BitOps.CeilingPowerOfTwo(maximum), 8)];
135135
blockMask = (int)((uint)(table.Length) >> 3) - 1;

0 commit comments

Comments
 (0)