equal
deleted
inserted
replaced
510 // In the fullness of time, all users of the method should instead |
510 // In the fullness of time, all users of the method should instead |
511 // directly use allocate, besides being cleaner and faster, this will |
511 // directly use allocate, besides being cleaner and faster, this will |
512 // mean much better out of memory handling |
512 // mean much better out of memory handling |
513 unsigned char * |
513 unsigned char * |
514 JvmtiEnvBase::jvmtiMalloc(jlong size) { |
514 JvmtiEnvBase::jvmtiMalloc(jlong size) { |
515 unsigned char* mem; |
515 unsigned char* mem = NULL; |
516 jvmtiError result = allocate(size, &mem); |
516 jvmtiError result = allocate(size, &mem); |
517 assert(result == JVMTI_ERROR_NONE, "Allocate failed"); |
517 assert(result == JVMTI_ERROR_NONE, "Allocate failed"); |
518 return mem; |
518 return mem; |
519 } |
519 } |
520 |
520 |
1030 ret.entry_count = count_locked_objects(owning_thread, hobj); |
1030 ret.entry_count = count_locked_objects(owning_thread, hobj); |
1031 } |
1031 } |
1032 // implied else: entry_count == 0 |
1032 // implied else: entry_count == 0 |
1033 } |
1033 } |
1034 |
1034 |
1035 jint nWant, nWait; |
1035 jint nWant = 0, nWait = 0; |
1036 if (mon != NULL) { |
1036 if (mon != NULL) { |
1037 // this object has a heavyweight monitor |
1037 // this object has a heavyweight monitor |
1038 nWant = mon->contentions(); // # of threads contending for monitor |
1038 nWant = mon->contentions(); // # of threads contending for monitor |
1039 nWait = mon->waiters(); // # of threads in Object.wait() |
1039 nWait = mon->waiters(); // # of threads in Object.wait() |
1040 ret.waiter_count = nWant + nWait; |
1040 ret.waiter_count = nWant + nWait; |