comparison src/share/vm/utilities/debug.hpp @ 10161:746b070f5022

8011661: Insufficient memory message says "malloc" when sometimes it should say "mmap" Reviewed-by: coleenp, zgu, hseigel
author ccheung
date Tue, 30 Apr 2013 11:56:52 -0700
parents be4d5c6c1f79
children 836a62f43af9 59b052799158
comparison
equal deleted inserted replaced
10160:ed5a590835a4 10161:746b070f5022
172 report_fatal(__FILE__, __LINE__, msg); \ 172 report_fatal(__FILE__, __LINE__, msg); \
173 BREAKPOINT; \ 173 BREAKPOINT; \
174 } while (0) 174 } while (0)
175 175
176 // out of memory 176 // out of memory
177 #define vm_exit_out_of_memory(size, msg) \ 177 #define vm_exit_out_of_memory(size, vm_err_type, msg) \
178 do { \ 178 do { \
179 report_vm_out_of_memory(__FILE__, __LINE__, size, msg); \ 179 report_vm_out_of_memory(__FILE__, __LINE__, size, vm_err_type, msg); \
180 BREAKPOINT; \ 180 BREAKPOINT; \
181 } while (0) 181 } while (0)
182 182
183 #define ShouldNotCallThis() \ 183 #define ShouldNotCallThis() \
184 do { \ 184 do { \
201 #define Untested(msg) \ 201 #define Untested(msg) \
202 do { \ 202 do { \
203 report_untested(__FILE__, __LINE__, msg); \ 203 report_untested(__FILE__, __LINE__, msg); \
204 BREAKPOINT; \ 204 BREAKPOINT; \
205 } while (0); 205 } while (0);
206
207
208 // types of VM error - originally in vmError.hpp
209 enum VMErrorType {
210 INTERNAL_ERROR = 0xe0000000,
211 OOM_MALLOC_ERROR = 0xe0000001,
212 OOM_MMAP_ERROR = 0xe0000002
213 };
206 214
207 // error reporting helper functions 215 // error reporting helper functions
208 void report_vm_error(const char* file, int line, const char* error_msg, 216 void report_vm_error(const char* file, int line, const char* error_msg,
209 const char* detail_msg = NULL); 217 const char* detail_msg = NULL);
210 void report_fatal(const char* file, int line, const char* message); 218 void report_fatal(const char* file, int line, const char* message);
211 void report_vm_out_of_memory(const char* file, int line, size_t size, 219 void report_vm_out_of_memory(const char* file, int line, size_t size,
212 const char* message); 220 VMErrorType vm_err_type, const char* message);
213 void report_should_not_call(const char* file, int line); 221 void report_should_not_call(const char* file, int line);
214 void report_should_not_reach_here(const char* file, int line); 222 void report_should_not_reach_here(const char* file, int line);
215 void report_unimplemented(const char* file, int line); 223 void report_unimplemented(const char* file, int line);
216 void report_untested(const char* file, int line, const char* message); 224 void report_untested(const char* file, int line, const char* message);
217 225