Mercurial > hg > graal-jvmci-8
comparison src/share/vm/jvmci/jvmciRuntime.cpp @ 21876:d358434dd6b7
Use ressource array while parsing services rather than leak a heap array
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Tue, 09 Jun 2015 13:19:52 +0200 |
parents | 431b127fc0d1 |
children | 35affb9c707a |
comparison
equal
deleted
inserted
replaced
21875:431b127fc0d1 | 21876:d358434dd6b7 |
---|---|
1179 GrowableArray<char*> _implNames; | 1179 GrowableArray<char*> _implNames; |
1180 public: | 1180 public: |
1181 ServiceParseClosure() : _implNames() {} | 1181 ServiceParseClosure() : _implNames() {} |
1182 void do_line(char* line) { | 1182 void do_line(char* line) { |
1183 size_t lineLen = strlen(line); | 1183 size_t lineLen = strlen(line); |
1184 char* implName = NEW_C_HEAP_ARRAY(char, lineLen + 1, mtCompiler); // TODO (gd) i'm leaking | 1184 char* implName = NEW_RESOURCE_ARRAY(char, lineLen + 1); |
1185 // Turn all '.'s into '/'s | 1185 // Turn all '.'s into '/'s |
1186 for (size_t index = 0; index < lineLen; ++index) { | 1186 for (size_t index = 0; index < lineLen; ++index) { |
1187 if (line[index] == '.') { | 1187 if (line[index] == '.') { |
1188 implName[index] = '/'; | 1188 implName[index] = '/'; |
1189 } else { | 1189 } else { |