src/hotspot/share/services/attachListener.hpp
changeset 54851 f67269c129f9
parent 54065 f984aca565c1
child 55682 70fab3a8ff02
equal deleted inserted replaced
54850:f8d45530b75e 54851:f67269c129f9
   119 
   119 
   120  public:
   120  public:
   121   const char* name() const                      { return _name; }
   121   const char* name() const                      { return _name; }
   122 
   122 
   123   // set the operation name
   123   // set the operation name
   124   void set_name(char* name) {
   124   void set_name(const char* name) {
   125     assert(strlen(name) <= name_length_max, "exceeds maximum name length");
   125     assert(strlen(name) <= name_length_max, "exceeds maximum name length");
   126     size_t len = MIN2(strlen(name), (size_t)name_length_max);
   126     size_t len = MIN2(strlen(name), (size_t)name_length_max);
   127     memcpy(_name, name, len);
   127     memcpy(_name, name, len);
   128     _name[len] = '\0';
   128     _name[len] = '\0';
   129   }
   129   }
   146       _arg[i][len] = '\0';
   146       _arg[i][len] = '\0';
   147     }
   147     }
   148   }
   148   }
   149 
   149 
   150   // create an operation of a given name
   150   // create an operation of a given name
   151   AttachOperation(char* name) {
   151   AttachOperation(const char* name) {
   152     set_name(name);
   152     set_name(name);
   153     for (int i=0; i<arg_count_max; i++) {
   153     for (int i=0; i<arg_count_max; i++) {
   154       set_arg(i, NULL);
   154       set_arg(i, NULL);
   155     }
   155     }
   156   }
   156   }