Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/coreclr/src/gc/unix/gcenv.unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ bool GCToOSInterface::Initialize()

if (st == 0)
{
for (size_t i = 0; i < g_totalCpuCount; i++)
for (size_t i = 0; i < CPU_SETSIZE; i++)
{
if (CPU_ISSET(i, &cpuSet))
{
Expand Down Expand Up @@ -1210,7 +1210,7 @@ bool GCToOSInterface::GetProcessorForHeap(uint16_t heap_number, uint16_t* proc_n
bool success = false;

uint16_t availableProcNumber = 0;
for (size_t procNumber = 0; procNumber < g_totalCpuCount; procNumber++)
for (size_t procNumber = 0; procNumber < MAX_SUPPORTED_CPUS; procNumber++)
{
if (g_processAffinitySet.Contains(procNumber))
{
Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/src/pal/src/thread/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2935,10 +2935,9 @@ PAL_GetCurrentThreadAffinitySet(SIZE_T size, UINT_PTR* data)
if (st == 0)
{
const SIZE_T BitsPerBitsetEntry = 8 * sizeof(UINT_PTR);
int nrcpus = PAL_GetTotalCpuCount();

// Get info for as much processors as it is possible to fit into the resulting set
SIZE_T remainingCount = std::min(size * BitsPerBitsetEntry, (SIZE_T)nrcpus);
SIZE_T remainingCount = std::min(size * BitsPerBitsetEntry, (SIZE_T)CPU_SETSIZE);
SIZE_T i = 0;
while (remainingCount != 0)
{
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/vm/gcenv.os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ bool GCToOSInterface::GetProcessorForHeap(uint16_t heap_number, uint16_t* proc_n
// Locate heap_number-th available processor
uint16_t procIndex;
size_t cnt = heap_number;
for (uint16_t i = 0; i < GCToOSInterface::GetTotalProcessorCount(); i++)
for (uint16_t i = 0; i < MAX_SUPPORTED_CPUS; i++)
{
if (g_processAffinitySet.Contains(i))
{
Expand Down