253 254 void warning(const char* format, ...) ATTRIBUTE_PRINTF(1, 2); 255 256 // Compile-time asserts. Cond must be a compile-time constant expression that 257 // is convertible to bool. STATIC_ASSERT() can be used anywhere a declaration 258 // may appear. 259 // 260 // Implementation Note: STATIC_ASSERT_FAILURE<true> provides a value member 261 // rather than type member that could be used directly in the typedef, because 262 // a type member would require conditional use of "typename", depending on 263 // whether Cond is dependent or not. The use of a value member leads to the 264 // use of an array type. 265 266 template<bool x> struct STATIC_ASSERT_FAILURE; 267 template<> struct STATIC_ASSERT_FAILURE<true> { enum { value = 1 }; }; 268 269 #define STATIC_ASSERT(Cond) \ 270 typedef char PASTE_TOKENS(STATIC_ASSERT_DUMMY_TYPE_, __LINE__)[ \ 271 STATIC_ASSERT_FAILURE< (Cond) >::value ] 272 273 // out of shared space reporting 274 enum SharedSpaceType { 275 SharedReadOnly, 276 SharedReadWrite, 277 SharedMiscData, 278 SharedMiscCode, 279 SharedOptional 280 }; 281 282 void report_out_of_shared_space(SharedSpaceType space_type); 283 284 void report_insufficient_metaspace(size_t required_size); 285 286 // out of memory reporting 287 void report_java_out_of_memory(const char* message); 288 289 // Support for self-destruct 290 bool is_error_reported(); 291 void set_error_reported(); 292 293 /* Test vmassert(), fatal(), guarantee(), etc. */ 294 NOT_PRODUCT(void test_error_handler();) 295 296 // crash in a controlled way: 297 // how can be one of: 298 // 1,2 - asserts 299 // 3,4 - guarantee 300 // 5-7 - fatal 301 // 8 - vm_exit_out_of_memory 302 // 9 - ShouldNotCallThis 303 // 10 - ShouldNotReachHere 304 // 11 - Unimplemented 305 // 12,13 - (not guaranteed) crashes | 253 254 void warning(const char* format, ...) ATTRIBUTE_PRINTF(1, 2); 255 256 // Compile-time asserts. Cond must be a compile-time constant expression that 257 // is convertible to bool. STATIC_ASSERT() can be used anywhere a declaration 258 // may appear. 259 // 260 // Implementation Note: STATIC_ASSERT_FAILURE<true> provides a value member 261 // rather than type member that could be used directly in the typedef, because 262 // a type member would require conditional use of "typename", depending on 263 // whether Cond is dependent or not. The use of a value member leads to the 264 // use of an array type. 265 266 template<bool x> struct STATIC_ASSERT_FAILURE; 267 template<> struct STATIC_ASSERT_FAILURE<true> { enum { value = 1 }; }; 268 269 #define STATIC_ASSERT(Cond) \ 270 typedef char PASTE_TOKENS(STATIC_ASSERT_DUMMY_TYPE_, __LINE__)[ \ 271 STATIC_ASSERT_FAILURE< (Cond) >::value ] 272 273 // out of memory reporting 274 void report_java_out_of_memory(const char* message); 275 276 // Support for self-destruct 277 bool is_error_reported(); 278 void set_error_reported(); 279 280 /* Test vmassert(), fatal(), guarantee(), etc. */ 281 NOT_PRODUCT(void test_error_handler();) 282 283 // crash in a controlled way: 284 // how can be one of: 285 // 1,2 - asserts 286 // 3,4 - guarantee 287 // 5-7 - fatal 288 // 8 - vm_exit_out_of_memory 289 // 9 - ShouldNotCallThis 290 // 10 - ShouldNotReachHere 291 // 11 - Unimplemented 292 // 12,13 - (not guaranteed) crashes |