8012015: Use PROT_NONE when reserving memory

Reserved memory had PROT_READ+PROT_WRITE access on Linux/bsd, now changed to PROT_NONE.

Reviewed-by: dholmes, ctornqvi
This commit is contained in:
Mikael Vidstedt 2013-04-29 11:03:49 -07:00
parent c108e3a79f
commit 9e8a3585b0
5 changed files with 96 additions and 6 deletions

View file

@ -320,6 +320,11 @@ WB_ENTRY(void, WB_FullGC(JNIEnv* env, jobject o))
Universe::heap()->collect(GCCause::_last_ditch_collection);
WB_END
WB_ENTRY(jlong, WB_ReserveMemory(JNIEnv* env, jobject o, jlong size))
return (jlong)os::reserve_memory(size, NULL, 0);
WB_END
//Some convenience methods to deal with objects from java
int WhiteBox::offset_for_field(const char* field_name, oop object,
Symbol* signature_symbol) {
@ -421,6 +426,8 @@ static JNINativeMethod methods[] = {
CC"(Ljava/lang/reflect/Executable;)V", (void*)&WB_ClearMethodState},
{CC"isInStringTable", CC"(Ljava/lang/String;)Z", (void*)&WB_IsInStringTable },
{CC"fullGC", CC"()V", (void*)&WB_FullGC },
{CC"reserveMemory", CC"(J)J", (void*)&WB_ReserveMemory },
};
#undef CC