mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-28 14:22:24 +00:00
8184762: ZapStackSegments should use optimized memset
Reviewed-by: rkennke, mgerdin
This commit is contained in:
parent
cfd0efee84
commit
e8485a5e09
@ -949,6 +949,7 @@ const jint badInt = -3; // generic "bad int"
|
||||
const long badAddressVal = -2; // generic "bad address" value
|
||||
const long badOopVal = -1; // generic "bad oop" value
|
||||
const intptr_t badHeapOopVal = (intptr_t) CONST64(0x2BAD4B0BBAADBABE); // value used to zap heap after GC
|
||||
const int badStackSegVal = 0xCA; // value used to zap stack segments
|
||||
const int badHandleValue = 0xBC; // value used to zap vm handle area
|
||||
const int badResourceValue = 0xAB; // value used to zap resource area
|
||||
const int freeBlockPad = 0xBA; // value used to pad freed blocks.
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
|
||||
#include "utilities/align.hpp"
|
||||
#include "utilities/stack.hpp"
|
||||
#include "utilities/copy.hpp"
|
||||
|
||||
template <MEMFLAGS F> StackBase<F>::StackBase(size_t segment_size, size_t max_cache_size,
|
||||
size_t max_size):
|
||||
@ -233,11 +234,7 @@ void Stack<E, F>::zap_segment(E* seg, bool zap_link_field) const
|
||||
{
|
||||
if (!ZapStackSegments) return;
|
||||
const size_t zap_bytes = segment_bytes() - (zap_link_field ? 0 : sizeof(E*));
|
||||
uint32_t* cur = (uint32_t*)seg;
|
||||
const uint32_t* end = cur + zap_bytes / sizeof(uint32_t);
|
||||
while (cur < end) {
|
||||
*cur++ = 0xfadfaded;
|
||||
}
|
||||
Copy::fill_to_bytes(seg, zap_bytes, badStackSegVal);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user