comparison src/share/vm/memory/allocation.cpp @ 23822:626f594dffa6

8139040: Fix initializations before ShouldNotReachHere() etc. and enable -Wuninitialized on linux. Reviewed-by: stuefe, coleenp, roland
author csahu
date Tue, 01 Mar 2016 12:50:37 +0530
parents 833b0f92429a
children f13e777eb255
comparison
equal deleted inserted replaced
23821:2f8db587e1fc 23822:626f594dffa6
81 void MetaspaceObj::print_address_on(outputStream* st) const { 81 void MetaspaceObj::print_address_on(outputStream* st) const {
82 st->print(" {" INTPTR_FORMAT "}", p2i(this)); 82 st->print(" {" INTPTR_FORMAT "}", p2i(this));
83 } 83 }
84 84
85 void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flags) throw() { 85 void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flags) throw() {
86 address res; 86 address res = NULL;
87 switch (type) { 87 switch (type) {
88 case C_HEAP: 88 case C_HEAP:
89 res = (address)AllocateHeap(size, flags, CALLER_PC); 89 res = (address)AllocateHeap(size, flags, CALLER_PC);
90 DEBUG_ONLY(set_allocation_type(res, C_HEAP);) 90 DEBUG_ONLY(set_allocation_type(res, C_HEAP);)
91 break; 91 break;
103 return (address) operator new(size, type, flags); 103 return (address) operator new(size, type, flags);
104 } 104 }
105 105
106 void* ResourceObj::operator new(size_t size, const std::nothrow_t& nothrow_constant, 106 void* ResourceObj::operator new(size_t size, const std::nothrow_t& nothrow_constant,
107 allocation_type type, MEMFLAGS flags) throw() { 107 allocation_type type, MEMFLAGS flags) throw() {
108 //should only call this with std::nothrow, use other operator new() otherwise 108 // should only call this with std::nothrow, use other operator new() otherwise
109 address res; 109 address res = NULL;
110 switch (type) { 110 switch (type) {
111 case C_HEAP: 111 case C_HEAP:
112 res = (address)AllocateHeap(size, flags, CALLER_PC, AllocFailStrategy::RETURN_NULL); 112 res = (address)AllocateHeap(size, flags, CALLER_PC, AllocFailStrategy::RETURN_NULL);
113 DEBUG_ONLY(if (res!= NULL) set_allocation_type(res, C_HEAP);) 113 DEBUG_ONLY(if (res!= NULL) set_allocation_type(res, C_HEAP);)
114 break; 114 break;