341
342 static MetaspaceObj::Type array_type(size_t elem_size) {
343 switch (elem_size) {
344 case 1: return TypeArrayU1Type;
345 case 2: return TypeArrayU2Type;
346 case 4: return TypeArrayU4Type;
347 case 8: return TypeArrayU8Type;
348 default:
349 return TypeArrayOtherType;
350 }
351 }
352
353 void* operator new(size_t size, ClassLoaderData* loader_data,
354 size_t word_size,
355 Type type, JavaThread* thread) throw();
356 // can't use TRAPS from this header file.
357 void* operator new(size_t size, ClassLoaderData* loader_data,
358 size_t word_size,
359 Type type) throw();
360 // This is used for allocating training data. We are allocating training data in many cases where a GC cannot be triggered.
361 void* operator new(size_t size, MemTag flags) throw();
362 void operator delete(void* p) = delete;
363
364 // Declare a *static* method with the same signature in any subclass of MetaspaceObj
365 // that should be read-only by default. See symbol.hpp for an example. This function
366 // is used by the templates in metaspaceClosure.hpp
367 static bool is_read_only_by_default() { return false; }
368 };
369
370 // Base class for classes that constitute name spaces.
371
372 class Arena;
373
374 extern char* resource_allocate_bytes(size_t size,
375 AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM);
376 extern char* resource_allocate_bytes(Thread* thread, size_t size,
377 AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM);
378 extern char* resource_reallocate_bytes( char *old, size_t old_size, size_t new_size,
379 AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM);
380 extern void resource_free_bytes( Thread* thread, char *old, size_t size );
381
|
341
342 static MetaspaceObj::Type array_type(size_t elem_size) {
343 switch (elem_size) {
344 case 1: return TypeArrayU1Type;
345 case 2: return TypeArrayU2Type;
346 case 4: return TypeArrayU4Type;
347 case 8: return TypeArrayU8Type;
348 default:
349 return TypeArrayOtherType;
350 }
351 }
352
353 void* operator new(size_t size, ClassLoaderData* loader_data,
354 size_t word_size,
355 Type type, JavaThread* thread) throw();
356 // can't use TRAPS from this header file.
357 void* operator new(size_t size, ClassLoaderData* loader_data,
358 size_t word_size,
359 Type type) throw();
360 // This is used for allocating training data. We are allocating training data in many cases where a GC cannot be triggered.
361 void* operator new(size_t size, MemTag flags);
362 void operator delete(void* p) = delete;
363
364 // Declare a *static* method with the same signature in any subclass of MetaspaceObj
365 // that should be read-only by default. See symbol.hpp for an example. This function
366 // is used by the templates in metaspaceClosure.hpp
367 static bool is_read_only_by_default() { return false; }
368 };
369
370 // Base class for classes that constitute name spaces.
371
372 class Arena;
373
374 extern char* resource_allocate_bytes(size_t size,
375 AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM);
376 extern char* resource_allocate_bytes(Thread* thread, size_t size,
377 AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM);
378 extern char* resource_reallocate_bytes( char *old, size_t old_size, size_t new_size,
379 AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM);
380 extern void resource_free_bytes( Thread* thread, char *old, size_t size );
381
|