-
Notifications
You must be signed in to change notification settings - Fork 5.2k
handle case of Proc Index > MAX_SUPPORTED_CPUS #109295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6450,7 +6450,11 @@ class heap_select | |
if (GCToOSInterface::CanGetCurrentProcessorNumber()) | ||
{ | ||
uint32_t proc_no = GCToOSInterface::GetCurrentProcessorNumber(); | ||
proc_no_to_heap_no[proc_no] = (uint16_t)heap_number; | ||
// For a 32-bit process running on a machine with > 64 procs, | ||
// even though the process can only use up to 32 procs, the processor | ||
// index can be >= 64; or in the cpu group case, if the process is not running in cpu group #0, | ||
// the GetCurrentProcessorNumber will return a number that's >= 64. | ||
proc_no_to_heap_no[proc_no % MAX_SUPPORTED_CPUS] = (uint16_t)heap_number; | ||
} | ||
} | ||
|
||
|
@@ -6472,7 +6476,11 @@ class heap_select | |
if (GCToOSInterface::CanGetCurrentProcessorNumber()) | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know this was code from before but do we need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't believe that could occur. |
||
uint32_t proc_no = GCToOSInterface::GetCurrentProcessorNumber(); | ||
int adjusted_heap = proc_no_to_heap_no[proc_no]; | ||
// For a 32-bit process running on a machine with > 64 procs, | ||
// even though the process can only use up to 32 procs, the processor | ||
// index can be >= 64; or in the cpu group case, if the process is not running in cpu group #0, | ||
// the GetCurrentProcessorNumber will return a number that's >= 64. | ||
int adjusted_heap = proc_no_to_heap_no[proc_no % MAX_SUPPORTED_CPUS]; | ||
// with dynamic heap count, need to make sure the value is in range. | ||
if (adjusted_heap >= gc_heap::n_heaps) | ||
{ | ||
|
Uh oh!
There was an error while loading. Please reload this page.