src/hotspot/share/services/diagnosticArgument.hpp
changeset 48157 7c4d43c26352
parent 47216 71c04702a3d5
child 50600 8e17fffa0a4b
--- a/src/hotspot/share/services/diagnosticArgument.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/services/diagnosticArgument.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -35,29 +35,14 @@
 private:
   GrowableArray<char*>* _array;
 public:
-  StringArrayArgument() {
-    _array = new(ResourceObj::C_HEAP, mtInternal)GrowableArray<char *>(32, true);
-    assert(_array != NULL, "Sanity check");
-  }
-  void add(const char* str, size_t len) {
-    if (str != NULL) {
-      char* ptr = NEW_C_HEAP_ARRAY(char, len+1, mtInternal);
-      strncpy(ptr, str, len);
-      ptr[len] = 0;
-      _array->append(ptr);
-    }
-  }
+  StringArrayArgument();
+  ~StringArrayArgument();
+
+  void add(const char* str, size_t len);
+
   GrowableArray<char*>* array() {
     return _array;
   }
-  ~StringArrayArgument() {
-    for (int i=0; i<_array->length(); i++) {
-      if(_array->at(i) != NULL) { // Safety check
-        FREE_C_HEAP_ARRAY(char, _array->at(i));
-      }
-    }
-    delete _array;
-  }
 };
 
 class NanoTimeArgument {