comparison src/share/vm/memory/allocation.hpp @ 1836:894b1d7c7e01

6423256: GC stacks should use a better data structure 6942771: SEGV in ParScanThreadState::take_from_overflow_stack Reviewed-by: apetrusenko, ysr, pbk
author jcoomes
date Tue, 28 Sep 2010 15:56:15 -0700
parents f4f596978298
children f95d63e2154a
comparison
equal deleted inserted replaced
1835:4805b9f4779e 1836:894b1d7c7e01
287 } 287 }
288 }; 288 };
289 289
290 // One of the following macros must be used when allocating 290 // One of the following macros must be used when allocating
291 // an array or object from an arena 291 // an array or object from an arena
292 #define NEW_ARENA_ARRAY(arena, type, size)\ 292 #define NEW_ARENA_ARRAY(arena, type, size) \
293 (type*) arena->Amalloc((size) * sizeof(type)) 293 (type*) (arena)->Amalloc((size) * sizeof(type))
294 294
295 #define REALLOC_ARENA_ARRAY(arena, type, old, old_size, new_size)\ 295 #define REALLOC_ARENA_ARRAY(arena, type, old, old_size, new_size) \
296 (type*) arena->Arealloc((char*)(old), (old_size) * sizeof(type), (new_size) * sizeof(type) ) 296 (type*) (arena)->Arealloc((char*)(old), (old_size) * sizeof(type), \
297 297 (new_size) * sizeof(type) )
298 #define FREE_ARENA_ARRAY(arena, type, old, size)\ 298
299 arena->Afree((char*)(old), (size) * sizeof(type)) 299 #define FREE_ARENA_ARRAY(arena, type, old, size) \
300 300 (arena)->Afree((char*)(old), (size) * sizeof(type))
301 #define NEW_ARENA_OBJ(arena, type)\ 301
302 #define NEW_ARENA_OBJ(arena, type) \
302 NEW_ARENA_ARRAY(arena, type, 1) 303 NEW_ARENA_ARRAY(arena, type, 1)
303 304
304 305
305 //%note allocation_1 306 //%note allocation_1
306 extern char* resource_allocate_bytes(size_t size); 307 extern char* resource_allocate_bytes(size_t size);