mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
Merge
This commit is contained in:
commit
f4c4fd7903
1070 changed files with 73926 additions and 38905 deletions
|
@ -595,6 +595,22 @@ void* os::malloc(size_t size, MEMFLAGS memflags, address caller) {
|
|||
NOT_PRODUCT(inc_stat_counter(&num_mallocs, 1));
|
||||
NOT_PRODUCT(inc_stat_counter(&alloc_bytes, size));
|
||||
|
||||
#ifdef ASSERT
|
||||
// checking for the WatcherThread and crash_protection first
|
||||
// since os::malloc can be called when the libjvm.{dll,so} is
|
||||
// first loaded and we don't have a thread yet.
|
||||
// try to find the thread after we see that the watcher thread
|
||||
// exists and has crash protection.
|
||||
WatcherThread *wt = WatcherThread::watcher_thread();
|
||||
if (wt != NULL && wt->has_crash_protection()) {
|
||||
Thread* thread = ThreadLocalStorage::get_thread_slow();
|
||||
if (thread == wt) {
|
||||
assert(!wt->has_crash_protection(),
|
||||
"Can't malloc with crash protection from WatcherThread");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (size == 0) {
|
||||
// return a valid pointer if size is zero
|
||||
// if NULL is returned the calling functions assume out of memory.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue