6917698: os::is_allocatable Zero fix for 32-bit platforms

Recent changes call os::is_allocatable which was not implemented in Zero.

Reviewed-by: twisti
This commit is contained in:
Edward Nevill 2010-01-18 05:02:41 -08:00 committed by Christian Thalinger
parent f839a363ca
commit 3ea93d46c4

View File

@ -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
}
///////////////////////////////////////////////////////////////////////////////