Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8289477: Memory corruption with CPU_ALLOC, CPU_FREE on muslc
Backport-of: da6d1fc0e0aeb1fdb504aced4b0dba0290ec240f
  • Loading branch information
tstuefe committed Jul 7, 2022
1 parent 3ad1445 commit db2010b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/hotspot/os/linux/os_linux.cpp
Expand Up @@ -4685,7 +4685,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 @@ -4757,6 +4758,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

1 comment on commit db2010b

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.