379 if (prefix_count == 0 || !is_valid()) { |
379 if (prefix_count == 0 || !is_valid()) { |
380 _native_method_prefix_count = 0; |
380 _native_method_prefix_count = 0; |
381 _native_method_prefixes = NULL; |
381 _native_method_prefixes = NULL; |
382 } else { |
382 } else { |
383 // there are prefixes, allocate an array to hold them, and fill it |
383 // there are prefixes, allocate an array to hold them, and fill it |
384 char** new_prefixes = (char**)os::malloc((prefix_count) * sizeof(char*)); |
384 char** new_prefixes = (char**)os::malloc((prefix_count) * sizeof(char*), mtInternal); |
385 if (new_prefixes == NULL) { |
385 if (new_prefixes == NULL) { |
386 return JVMTI_ERROR_OUT_OF_MEMORY; |
386 return JVMTI_ERROR_OUT_OF_MEMORY; |
387 } |
387 } |
388 for (int i = 0; i < prefix_count; i++) { |
388 for (int i = 0; i < prefix_count; i++) { |
389 char* prefix = prefixes[i]; |
389 char* prefix = prefixes[i]; |
1148 return JVMTI_ERROR_NONE; |
1148 return JVMTI_ERROR_NONE; |
1149 } |
1149 } |
1150 |
1150 |
1151 ResourceTracker::ResourceTracker(JvmtiEnv* env) { |
1151 ResourceTracker::ResourceTracker(JvmtiEnv* env) { |
1152 _env = env; |
1152 _env = env; |
1153 _allocations = new (ResourceObj::C_HEAP) GrowableArray<unsigned char*>(20, true); |
1153 _allocations = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<unsigned char*>(20, true); |
1154 _failed = false; |
1154 _failed = false; |
1155 } |
1155 } |
1156 ResourceTracker::~ResourceTracker() { |
1156 ResourceTracker::~ResourceTracker() { |
1157 if (_failed) { |
1157 if (_failed) { |
1158 for (int i=0; i<_allocations->length(); i++) { |
1158 for (int i=0; i<_allocations->length(); i++) { |