comparison src/share/vm/runtime/arguments.hpp @ 6204:90d5a592ea8f

Merge
author coleenp
date Thu, 12 Jul 2012 14:26:25 -0400
parents d2a62e0f25eb
children 957c266d8bc5 b9a9ed0f8eeb
comparison
equal deleted inserted replaced
6196:3759236eea14 6204:90d5a592ea8f
42 42
43 class SysClassPath; 43 class SysClassPath;
44 44
45 // Element describing System and User (-Dkey=value flags) defined property. 45 // Element describing System and User (-Dkey=value flags) defined property.
46 46
47 class SystemProperty: public CHeapObj { 47 class SystemProperty: public CHeapObj<mtInternal> {
48 private: 48 private:
49 char* _key; 49 char* _key;
50 char* _value; 50 char* _value;
51 SystemProperty* _next; 51 SystemProperty* _next;
52 bool _writeable; 52 bool _writeable;
61 bool set_value(char *value) { 61 bool set_value(char *value) {
62 if (writeable()) { 62 if (writeable()) {
63 if (_value != NULL) { 63 if (_value != NULL) {
64 FreeHeap(_value); 64 FreeHeap(_value);
65 } 65 }
66 _value = AllocateHeap(strlen(value)+1); 66 _value = AllocateHeap(strlen(value)+1, mtInternal);
67 if (_value != NULL) { 67 if (_value != NULL) {
68 strcpy(_value, value); 68 strcpy(_value, value);
69 } 69 }
70 return true; 70 return true;
71 } 71 }
78 if (value != NULL) { 78 if (value != NULL) {
79 len = strlen(value); 79 len = strlen(value);
80 if (_value != NULL) { 80 if (_value != NULL) {
81 len += strlen(_value); 81 len += strlen(_value);
82 } 82 }
83 sp = AllocateHeap(len+2); 83 sp = AllocateHeap(len+2, mtInternal);
84 if (sp != NULL) { 84 if (sp != NULL) {
85 if (_value != NULL) { 85 if (_value != NULL) {
86 strcpy(sp, _value); 86 strcpy(sp, _value);
87 strcat(sp, os::path_separator()); 87 strcat(sp, os::path_separator());
88 strcat(sp, value); 88 strcat(sp, value);
98 // Constructor 98 // Constructor
99 SystemProperty(const char* key, const char* value, bool writeable) { 99 SystemProperty(const char* key, const char* value, bool writeable) {
100 if (key == NULL) { 100 if (key == NULL) {
101 _key = NULL; 101 _key = NULL;
102 } else { 102 } else {
103 _key = AllocateHeap(strlen(key)+1); 103 _key = AllocateHeap(strlen(key)+1, mtInternal);
104 strcpy(_key, key); 104 strcpy(_key, key);
105 } 105 }
106 if (value == NULL) { 106 if (value == NULL) {
107 _value = NULL; 107 _value = NULL;
108 } else { 108 } else {
109 _value = AllocateHeap(strlen(value)+1); 109 _value = AllocateHeap(strlen(value)+1, mtInternal);
110 strcpy(_value, value); 110 strcpy(_value, value);
111 } 111 }
112 _next = NULL; 112 _next = NULL;
113 _writeable = writeable; 113 _writeable = writeable;
114 } 114 }
115 }; 115 };
116 116
117 117
118 // For use by -agentlib, -agentpath and -Xrun 118 // For use by -agentlib, -agentpath and -Xrun
119 class AgentLibrary : public CHeapObj { 119 class AgentLibrary : public CHeapObj<mtInternal> {
120 friend class AgentLibraryList; 120 friend class AgentLibraryList;
121 private: 121 private:
122 char* _name; 122 char* _name;
123 char* _options; 123 char* _options;
124 void* _os_lib; 124 void* _os_lib;
134 void set_os_lib(void* os_lib) { _os_lib = os_lib; } 134 void set_os_lib(void* os_lib) { _os_lib = os_lib; }
135 AgentLibrary* next() const { return _next; } 135 AgentLibrary* next() const { return _next; }
136 136
137 // Constructor 137 // Constructor
138 AgentLibrary(const char* name, const char* options, bool is_absolute_path, void* os_lib) { 138 AgentLibrary(const char* name, const char* options, bool is_absolute_path, void* os_lib) {
139 _name = AllocateHeap(strlen(name)+1); 139 _name = AllocateHeap(strlen(name)+1, mtInternal);
140 strcpy(_name, name); 140 strcpy(_name, name);
141 if (options == NULL) { 141 if (options == NULL) {
142 _options = NULL; 142 _options = NULL;
143 } else { 143 } else {
144 _options = AllocateHeap(strlen(options)+1); 144 _options = AllocateHeap(strlen(options)+1, mtInternal);
145 strcpy(_options, options); 145 strcpy(_options, options);
146 } 146 }
147 _is_absolute_path = is_absolute_path; 147 _is_absolute_path = is_absolute_path;
148 _os_lib = os_lib; 148 _os_lib = os_lib;
149 _next = NULL; 149 _next = NULL;