Mercurial > hg > graal-jvmci-8
diff src/os_cpu/linux_zero/vm/os_linux_zero.cpp @ 1176:d11ce1551e8d
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 <ed@camswl.com>
author | twisti |
---|---|
date | Mon, 18 Jan 2010 05:02:41 -0800 |
parents | 354d3184f6b2 |
children | 67d74f7a15d9 |
line wrap: on
line diff
--- a/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Fri Jan 15 16:15:45 2010 -0800 +++ b/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Mon Jan 18 05:02:41 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 @@ -239,7 +239,21 @@ } 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 } ///////////////////////////////////////////////////////////////////////////////