comparison src/share/vm/runtime/os.hpp @ 656:6bdd6923ba16

6541756: Reduce executable C-heap Summary: Add executable parameters to reserve_memory and commit_memory to reduce executable memory to only the Code Heap. Reviewed-by: xlu, kvn, acorn
author coleenp
date Wed, 25 Mar 2009 14:19:20 -0400
parents bd441136a5ce
children 956304450e80
comparison
equal deleted inserted replaced
655:60bfce711da4 656:6bdd6923ba16
200 static char* reserve_memory(size_t bytes, char* addr = 0, 200 static char* reserve_memory(size_t bytes, char* addr = 0,
201 size_t alignment_hint = 0); 201 size_t alignment_hint = 0);
202 static char* attempt_reserve_memory_at(size_t bytes, char* addr); 202 static char* attempt_reserve_memory_at(size_t bytes, char* addr);
203 static void split_reserved_memory(char *base, size_t size, 203 static void split_reserved_memory(char *base, size_t size,
204 size_t split, bool realloc); 204 size_t split, bool realloc);
205 static bool commit_memory(char* addr, size_t bytes); 205 static bool commit_memory(char* addr, size_t bytes,
206 static bool commit_memory(char* addr, size_t size, size_t alignment_hint); 206 bool executable = false);
207 static bool commit_memory(char* addr, size_t size, size_t alignment_hint,
208 bool executable = false);
207 static bool uncommit_memory(char* addr, size_t bytes); 209 static bool uncommit_memory(char* addr, size_t bytes);
208 static bool release_memory(char* addr, size_t bytes); 210 static bool release_memory(char* addr, size_t bytes);
209 211
210 enum ProtType { MEM_PROT_NONE, MEM_PROT_READ, MEM_PROT_RW, MEM_PROT_RWX }; 212 enum ProtType { MEM_PROT_NONE, MEM_PROT_READ, MEM_PROT_RW, MEM_PROT_RWX };
211 static bool protect_memory(char* addr, size_t bytes, ProtType prot, 213 static bool protect_memory(char* addr, size_t bytes, ProtType prot,
241 static bool get_page_info(char *start, page_info* info); 243 static bool get_page_info(char *start, page_info* info);
242 static char* scan_pages(char *start, char* end, page_info* page_expected, page_info* page_found); 244 static char* scan_pages(char *start, char* end, page_info* page_expected, page_info* page_found);
243 245
244 static char* non_memory_address_word(); 246 static char* non_memory_address_word();
245 // reserve, commit and pin the entire memory region 247 // reserve, commit and pin the entire memory region
246 static char* reserve_memory_special(size_t size, char* addr = NULL); 248 static char* reserve_memory_special(size_t size, char* addr = NULL,
249 bool executable = false);
247 static bool release_memory_special(char* addr, size_t bytes); 250 static bool release_memory_special(char* addr, size_t bytes);
248 static bool large_page_init(); 251 static bool large_page_init();
249 static size_t large_page_size(); 252 static size_t large_page_size();
250 static bool can_commit_large_page_memory(); 253 static bool can_commit_large_page_memory();
251 static bool can_execute_large_page_memory(); 254 static bool can_execute_large_page_memory();