- fix build for systems with > 2G physical memory (signed int value was

assigned to uint64).
- set some fall-back max-memory values to reasonable values for OpenBSD.
Problem reported and update tested by Douglas Santos.
This commit is contained in:
kurt 2005-11-30 02:21:32 +00:00
parent cc3bd646d2
commit 56509860b6
3 changed files with 49 additions and 7 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.8 2005/11/23 19:39:13 kurt Exp $
# $OpenBSD: Makefile,v 1.9 2005/11/30 02:21:32 kurt Exp $
ONLY_FOR_ARCHS= i386
@ -6,8 +6,8 @@ COMMENT= "Java2(TM) Standard Edition Dev Kit v${V}"
COMMENT-jre= "Java2(TM) Standard Edition Runtime Environment v${V}"
V= 1.5.0
DISTNAME= jdk-1_5_0
PKGNAME= jdk-${V}p4
PKGNAME-jre= jre-${V}p4
PKGNAME= jdk-${V}p5
PKGNAME-jre= jre-${V}p5
CATEGORIES= devel/jdk java

View File

@ -1,7 +1,33 @@
$OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.3 2005/11/22 14:43:05 kurt Exp $
--- hotspot/src/os/bsd/vm/os_bsd.cpp.orig Wed Nov 16 09:11:20 2005
+++ hotspot/src/os/bsd/vm/os_bsd.cpp Wed Nov 16 09:11:48 2005
@@ -429,7 +429,9 @@ void os::init_system_properties_values()
$OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.4 2005/11/30 02:21:32 kurt Exp $
--- hotspot/src/os/bsd/vm/os_bsd.cpp.orig Tue Nov 22 10:16:29 2005
+++ hotspot/src/os/bsd/vm/os_bsd.cpp Tue Nov 29 09:47:23 2005
@@ -290,8 +290,15 @@ julong os::allocatable_physical_memory(j
// is not known at this point. Alignments will
// be at most to LargePageSizeInBytes. Protect
// allocations from alignments up to illegal
- // values. If at this point 2G is illegal.
+ // values.
+// XXXBSD: This really should be using rlimit to get the actual
+// value and perhaps automaticlly increasing the current rlimit
+// up to the min(rlimit max, size)
+#ifdef __OpenBSD__
+ julong reasonable_size = (julong)1*G - 2 * LargePageSizeInBytes;
+#else
julong reasonable_size = (julong)2*G - 2 * LargePageSizeInBytes;
+#endif
result = MIN2(size, reasonable_size);
}
return result;
@@ -313,7 +320,7 @@ static volatile int max_hrtime_lock = LO
void os::Bsd::initialize_system_info() {
int mib[2];
size_t len;
- int val;
+ u_int val;
/* get processors count via hw.ncpus sysctl */
mib[0] = CTL_HW;
@@ -429,7 +436,9 @@ void os::init_system_properties_values()
#define malloc(n) (char*)NEW_C_HEAP_ARRAY(char, (n))
#define getenv(n) ::getenv(n)

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-hotspot_src_os_cpu_bsd_i486_vm_os_bsd_i486_cpp,v 1.3 2005/11/30 02:21:32 kurt Exp $
--- hotspot/src/os_cpu/bsd_i486/vm/os_bsd_i486.cpp.orig Tue Nov 29 09:54:02 2005
+++ hotspot/src/os_cpu/bsd_i486/vm/os_bsd_i486.cpp Tue Nov 29 09:55:00 2005
@@ -350,9 +350,12 @@ bool os::supports_sse() {
bool os::is_allocatable(size_t bytes) {
+// XXXBSD: 1*G for OpenBSD or just check?
+#ifndef __OpenBSD__
if (bytes < 2 * G) {
return true;
}
+#endif
char* addr = reserve_memory(bytes, NULL);