Skip to content
Permalink
Browse files
Automatic merge of jdk:master into master
  • Loading branch information
duke committed Mar 25, 2021
2 parents 3523cb7 + d602ae0 commit d9a180d6497a9113cbfdcd9bdd19c4648f0a5781
Showing 13 changed files with 20 additions and 96 deletions.
@@ -546,6 +546,26 @@ bool os::get_host_name(char* buf, size_t buflen) {
return true;
}

#ifndef _LP64
// Helper, on 32bit, for os::has_allocatable_memory_limit
static bool is_allocatable(size_t s) {
if (s < 2 * G) {
return true;
}
// Use raw anonymous mmap here; no need to go through any
// of our reservation layers. We will unmap right away.
void* p = ::mmap(NULL, s, PROT_NONE,
MAP_PRIVATE | MAP_NORESERVE | MAP_ANONYMOUS, -1, 0);
if (p == MAP_FAILED) {
return false;
} else {
::munmap(p, s);
return true;
}
}
#endif // !_LP64


bool os::has_allocatable_memory_limit(size_t* limit) {
struct rlimit rlim;
int getrlimit_res = getrlimit(RLIMIT_AS, &rlim);
@@ -641,26 +641,6 @@ bool os::supports_sse() {
return true;
}

bool os::is_allocatable(size_t bytes) {
#ifdef AMD64
// unused on amd64?
return true;
#else

if (bytes < 2 * G) {
return true;
}

char* addr = reserve_memory(bytes);

if (addr != NULL) {
release_memory(addr, bytes);
}

return addr != NULL;
#endif // AMD64
}

juint os::cpu_microcode_revision() {
juint result = 0;
char data[8];
@@ -37,8 +37,6 @@

static jlong rdtsc();

static bool is_allocatable(size_t bytes);

// Used to register dynamic code cache area with the OS
// Note: Currently only used in 64 bit Windows implementations
static bool register_code_area(char *low, char *high) { return true; }
@@ -158,24 +158,6 @@ void os::Bsd::init_thread_fpu_state(void) {
// Nothing to do
}

bool os::is_allocatable(size_t bytes) {
#ifdef _LP64
return true;
#else
if (bytes < 2 * G) {
return true;
}

char* addr = reserve_memory(bytes);

if (addr != NULL) {
release_memory(addr, bytes);
}

return addr != NULL;
#endif // _LP64
}

///////////////////////////////////////////////////////////////////////////////
// thread stack

@@ -28,8 +28,6 @@

static void setup_fpu() {}

static bool is_allocatable(size_t bytes);

// Used to register dynamic code cache area with the OS
// Note: Currently only used in 64 bit Windows implementations
static bool register_code_area(char *low, char *high) { return true; }
@@ -304,10 +304,6 @@ int os::Linux::get_fpu_control_word(void) {
void os::Linux::set_fpu_control_word(int fpu_control) {
}

bool os::is_allocatable(size_t bytes) {
return true;
}

////////////////////////////////////////////////////////////////////////////////
// thread stack

@@ -32,8 +32,6 @@

static void setup_fpu();

static bool is_allocatable(size_t bytes);

// Used to register dynamic code cache area with the OS
// Note: Currently only used in 64 bit Windows implementations
static bool register_code_area(char *low, char *high) { return true; }
@@ -413,10 +413,6 @@ void os::setup_fpu() {
#endif
}

bool os::is_allocatable(size_t bytes) {
return true;
}

////////////////////////////////////////////////////////////////////////////////
// thread stack

@@ -34,8 +34,6 @@

static void setup_fpu();

static bool is_allocatable(size_t bytes);

// Used to register dynamic code cache area with the OS
// Note: Currently only used in 64 bit Windows implementations
static bool register_code_area(char *low, char *high) { return true; }
@@ -478,26 +478,6 @@ juint os::cpu_microcode_revision() {
return result;
}

bool os::is_allocatable(size_t bytes) {
#ifdef AMD64
// unused on amd64?
return true;
#else

if (bytes < 2 * G) {
return true;
}

char* addr = reserve_memory(bytes);

if (addr != NULL) {
release_memory(addr, bytes);
}

return addr != NULL;
#endif // AMD64
}

////////////////////////////////////////////////////////////////////////////////
// thread stack

@@ -31,8 +31,6 @@

static jlong rdtsc();

static bool is_allocatable(size_t bytes);

// Used to register dynamic code cache area with the OS
// Note: Currently only used in 64 bit Windows implementations
static bool register_code_area(char *low, char *high) { return true; }
@@ -182,24 +182,6 @@ void os::Linux::set_fpu_control_word(int fpu) {
ShouldNotCallThis();
}

bool os::is_allocatable(size_t bytes) {
#ifdef _LP64
return true;
#else
if (bytes < 2 * G) {
return true;
}

char* addr = reserve_memory(bytes);

if (addr != NULL) {
release_memory(addr, bytes);
}

return addr != NULL;
#endif // _LP64
}

///////////////////////////////////////////////////////////////////////////////
// thread stack

@@ -28,8 +28,6 @@

static void setup_fpu() {}

static bool is_allocatable(size_t bytes);

// Used to register dynamic code cache area with the OS
// Note: Currently only used in 64 bit Windows implementations
static bool register_code_area(char *low, char *high) { return true; }

0 comments on commit d9a180d

Please sign in to comment.