changeset 1262:e2b5130a5a31

. Make BSD specific changes equivalent to the Linux specific changes.
author Greg Lewis <glewis@eyesbeyond.com>
date Sat, 30 Jan 2010 17:31:48 -0800
parents 16e9586714fe
children 19a01d90250f
files src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp
diffstat 1 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp	Fri Jan 29 23:41:38 2010 -0800
+++ b/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp	Sat Jan 30 17:31:48 2010 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2007, 2008 Red Hat, Inc.
+ * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -247,7 +247,21 @@
 #endif
 
 bool os::is_allocatable(size_t bytes) {
-  ShouldNotCallThis();
+#ifdef _LP64
+  return true;
+#else
+  if (bytes < 2 * G) {
+    return true;
+  }
+
+  char* addr = reserve_memory(bytes, NULL);
+
+  if (addr != NULL) {
+    release_memory(addr, bytes);
+  }
+
+  return addr != NULL;
+#endif // _LP64
 }
 
 ///////////////////////////////////////////////////////////////////////////////