Skip to content
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

JDK-8289477: Memory corruption with CPU_ALLOC, CPU_FREE on muslc #9328

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/hotspot/os/linux/os_linux.cpp
Expand Up @@ -4591,7 +4591,8 @@ static int _cpu_count(const cpu_set_t* cpus) {
// dynamic check - see 6515172 for details.
// If anything goes wrong we fallback to returning the number of online
// processors - which can be greater than the number available to the process.
int os::Linux::active_processor_count() {
static int get_active_processor_count() {
// Note: keep this function, with its CPU_xx macros, *outside* the os namespace (see JDK-8289477).
cpu_set_t cpus; // can represent at most 1024 (CPU_SETSIZE) processors
cpu_set_t* cpus_p = &cpus;
int cpus_size = sizeof(cpu_set_t);
Expand Down Expand Up @@ -4663,6 +4664,10 @@ int os::Linux::active_processor_count() {
return cpu_count;
}

int os::Linux::active_processor_count() {
return get_active_processor_count();
}

// Determine the active processor count from one of
// three different sources:
//
Expand Down