3117 } |
3117 } |
3118 } |
3118 } |
3119 // Search for the base type by peeling off const and * |
3119 // Search for the base type by peeling off const and * |
3120 size_t len = strlen(typeName); |
3120 size_t len = strlen(typeName); |
3121 if (typeName[len-1] == '*') { |
3121 if (typeName[len-1] == '*') { |
3122 char * s = new char[len]; |
3122 char * s = NEW_C_HEAP_ARRAY(char, len, mtInternal); |
3123 strncpy(s, typeName, len - 1); |
3123 strncpy(s, typeName, len - 1); |
3124 s[len-1] = '\0'; |
3124 s[len-1] = '\0'; |
3125 // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName); |
3125 // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName); |
3126 if (recursiveFindType(origtypes, s, true) == 1) { |
3126 if (recursiveFindType(origtypes, s, true) == 1) { |
3127 delete [] s; |
3127 FREE_C_HEAP_ARRAY(char, s, mtInternal); |
3128 return 1; |
3128 return 1; |
3129 } |
3129 } |
3130 delete [] s; |
3130 FREE_C_HEAP_ARRAY(char, s, mtInternal); |
3131 } |
3131 } |
3132 const char* start = NULL; |
3132 const char* start = NULL; |
3133 if (strstr(typeName, "GrowableArray<") == typeName) { |
3133 if (strstr(typeName, "GrowableArray<") == typeName) { |
3134 start = typeName + strlen("GrowableArray<"); |
3134 start = typeName + strlen("GrowableArray<"); |
3135 } else if (strstr(typeName, "Array<") == typeName) { |
3135 } else if (strstr(typeName, "Array<") == typeName) { |
3136 start = typeName + strlen("Array<"); |
3136 start = typeName + strlen("Array<"); |
3137 } |
3137 } |
3138 if (start != NULL) { |
3138 if (start != NULL) { |
3139 const char * end = strrchr(typeName, '>'); |
3139 const char * end = strrchr(typeName, '>'); |
3140 int len = end - start + 1; |
3140 int len = end - start + 1; |
3141 char * s = new char[len]; |
3141 char * s = NEW_C_HEAP_ARRAY(char, len, mtInternal); |
3142 strncpy(s, start, len - 1); |
3142 strncpy(s, start, len - 1); |
3143 s[len-1] = '\0'; |
3143 s[len-1] = '\0'; |
3144 // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName); |
3144 // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName); |
3145 if (recursiveFindType(origtypes, s, true) == 1) { |
3145 if (recursiveFindType(origtypes, s, true) == 1) { |
3146 delete [] s; |
3146 FREE_C_HEAP_ARRAY(char, s, mtInternal); |
3147 return 1; |
3147 return 1; |
3148 } |
3148 } |
3149 delete [] s; |
3149 FREE_C_HEAP_ARRAY(char, s, mtInternal); |
3150 } |
3150 } |
3151 if (strstr(typeName, "const ") == typeName) { |
3151 if (strstr(typeName, "const ") == typeName) { |
3152 const char * s = typeName + strlen("const "); |
3152 const char * s = typeName + strlen("const "); |
3153 // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName); |
3153 // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName); |
3154 if (recursiveFindType(origtypes, s, true) == 1) { |
3154 if (recursiveFindType(origtypes, s, true) == 1) { |