From 3bcb9be2adf12aa09e728d4f64e58cdf9d488513 Mon Sep 17 00:00:00 2001 From: twisti Date: Mon, 18 Jan 2010 05:02:41 -0800 Subject: [PATCH] 6917698: os::is_allocatable Zero fix for 32-bit platforms Summary: Recent changes call os::is_allocatable which was not implemented in Zero. Reviewed-by: twisti Contributed-by: Edward Nevill --- src/os_cpu/linux_zero/vm/os_linux_zero.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/os_cpu/linux_zero/vm/os_linux_zero.cpp b/src/os_cpu/linux_zero/vm/os_linux_zero.cpp index 572702e7d..b9a140a51 100644 --- a/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +++ b/src/os_cpu/linux_zero/vm/os_linux_zero.cpp @@ -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 @@ -239,7 +239,21 @@ void os::Linux::set_fpu_control_word(int fpu) { } 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 } /////////////////////////////////////////////////////////////////////////////// -- GitLab