equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
236 |
236 |
237 void JfrThreadGroup::JfrThreadGroupEntry::set_thread_group_name(const char* tgname) { |
237 void JfrThreadGroup::JfrThreadGroupEntry::set_thread_group_name(const char* tgname) { |
238 assert(_thread_group_name == NULL, "invariant"); |
238 assert(_thread_group_name == NULL, "invariant"); |
239 if (tgname != NULL) { |
239 if (tgname != NULL) { |
240 size_t len = strlen(tgname); |
240 size_t len = strlen(tgname); |
241 _thread_group_name = JfrCHeapObj::new_array<char>(len+1); |
241 _thread_group_name = JfrCHeapObj::new_array<char>(len + 1); |
242 strncpy(_thread_group_name, tgname, len); |
242 strncpy(_thread_group_name, tgname, len + 1); |
243 _thread_group_name[len] = '\0'; |
|
244 } |
243 } |
245 } |
244 } |
246 |
245 |
247 const oop JfrThreadGroup::JfrThreadGroupEntry::thread_group() const { |
246 const oop JfrThreadGroup::JfrThreadGroupEntry::thread_group() const { |
248 return _thread_group_weak_ref != NULL ? JNIHandles::resolve(_thread_group_weak_ref) : _thread_group_oop; |
247 return _thread_group_weak_ref != NULL ? JNIHandles::resolve(_thread_group_weak_ref) : _thread_group_oop; |