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