mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
6885308: The incorrect -XX:StackRedPages, -XX:StackShadowPages, -XX:StackYellowPages could cause VM crash
Test minimal stack sizes given (also fixed linux compilation error) Reviewed-by: never, phh, coleenp
This commit is contained in:
parent
ae38e974f0
commit
b002fe5992
3 changed files with 28 additions and 2 deletions
|
@ -58,7 +58,7 @@ void* ResourceObj::operator new(size_t size, allocation_type type) {
|
|||
void ResourceObj::operator delete(void* p) {
|
||||
assert(((ResourceObj *)p)->allocated_on_C_heap(),
|
||||
"delete only allowed for C_HEAP objects");
|
||||
DEBUG_ONLY(((ResourceObj *)p)->_allocation = badHeapOopVal;)
|
||||
DEBUG_ONLY(((ResourceObj *)p)->_allocation = (uintptr_t)badHeapOopVal;)
|
||||
FreeHeap(p);
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ ResourceObj& ResourceObj::operator=(const ResourceObj& r) { // default copy assi
|
|||
ResourceObj::~ResourceObj() {
|
||||
// allocated_on_C_heap() also checks that encoded (in _allocation) address == this.
|
||||
if (!allocated_on_C_heap()) { // ResourceObj::delete() zaps _allocation for C_heap.
|
||||
_allocation = badHeapOopVal; // zap type
|
||||
_allocation = (uintptr_t)badHeapOopVal; // zap type
|
||||
}
|
||||
}
|
||||
#endif // ASSERT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue