summaryrefslogtreecommitdiff
path: root/src/pal/src
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2019-04-10 15:18:03 +0200
committerJan Vorlicek <janvorli@microsoft.com>2019-04-10 15:18:03 +0200
commitfe355a617ff5e56c8607c2b12c650c3b95c5cfbd (patch)
treec60b462e41a0d26ff13e960dcd64da00b7d4b4f9 /src/pal/src
parent3c07febf02b67c4c5f8eef846d5aa581372e454e (diff)
downloadcoreclr-fe355a617ff5e56c8607c2b12c650c3b95c5cfbd.tar.gz
coreclr-fe355a617ff5e56c8607c2b12c650c3b95c5cfbd.tar.bz2
coreclr-fe355a617ff5e56c8607c2b12c650c3b95c5cfbd.zip
Fix few issues discovered by testing
Diffstat (limited to 'src/pal/src')
-rw-r--r--src/pal/src/numa/numa.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/pal/src/numa/numa.cpp b/src/pal/src/numa/numa.cpp
index 4a07068ba4..4fb2bdb631 100644
--- a/src/pal/src/numa/numa.cpp
+++ b/src/pal/src/numa/numa.cpp
@@ -206,12 +206,11 @@ VirtualAllocExNuma(
{
int usedNodeMaskBits = g_highestNumaNode + 1;
int nodeMaskLength = (usedNodeMaskBits + sizeof(unsigned long) - 1) / sizeof(unsigned long);
- unsigned long *nodeMask = (unsigned long*)alloca(nodeMaskLength * sizeof(unsigned long));
- memset(nodeMask, 0, nodeMaskLength);
+ unsigned long nodeMask[nodeMaskLength];
+ memset(nodeMask, 0, sizeof(nodeMask));
int index = nndPreferred / sizeof(unsigned long);
- int mask = ((unsigned long)1) << (nndPreferred & (sizeof(unsigned long) - 1));
- nodeMask[index] = mask;
+ nodeMask[index] = ((unsigned long)1) << (nndPreferred & (sizeof(unsigned long) - 1));
int st = mbind(result, dwSize, MPOL_PREFERRED, nodeMask, usedNodeMaskBits, 0);