Skip to content

Commit 39b3237

Browse files
committed
move a few more PStatCollectors out of local statics
1 parent 1ead653 commit 39b3237

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

panda/src/pgraph/nodePath.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
int NodePath::_max_search_depth = 7000;
8181
TypeHandle NodePath::_type_handle;
8282

83+
PStatCollector NodePath::_get_transform_pcollector("*:NodePath:get_transform");
84+
PStatCollector NodePath::_verify_complete_pcollector("*:NodePath:verify_complete");
8385

8486
#ifdef HAVE_PYTHON
8587
#include "py_panda.h"
@@ -1097,7 +1099,6 @@ get_transform(Thread *current_thread) const {
10971099
CPT(TransformState) NodePath::
10981100
get_transform(const NodePath &other, Thread *current_thread) const {
10991101
nassertr(_error_type == ET_ok && other._error_type == ET_ok, TransformState::make_identity());
1100-
static PStatCollector _get_transform_pcollector("*:NodePath:get_transform");
11011102
PStatTimer timer(_get_transform_pcollector);
11021103

11031104
if (other.is_empty()) {
@@ -6509,7 +6510,6 @@ verify_complete(Thread *current_thread) const {
65096510
}
65106511
#endif // HAVE_THREADS
65116512

6512-
static PStatCollector _verify_complete_pcollector("*:NodePath:verify_complete");
65136513
PStatTimer timer(_verify_complete_pcollector);
65146514

65156515
const NodePathComponent *comp = _head;

panda/src/pgraph/nodePath.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,9 @@ class EXPCL_PANDA_PGRAPH NodePath {
989989
ErrorType _error_type;
990990
static int _max_search_depth;
991991

992+
static PStatCollector _get_transform_pcollector;
993+
static PStatCollector _verify_complete_pcollector;
994+
992995
public:
993996
static TypeHandle get_class_type() {
994997
return _type_handle;

panda/src/text/textNode.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
TypeHandle TextNode::_type_handle;
5454

55-
static PStatCollector text_generate_collector("*:Generate Text");
55+
PStatCollector TextNode::_text_generate_pcollector("*:Generate Text");
5656

5757
////////////////////////////////////////////////////////////////////
5858
// Function: TextNode::Constructor
@@ -343,7 +343,7 @@ write(ostream &out, int indent_level) const {
343343
////////////////////////////////////////////////////////////////////
344344
PT(PandaNode) TextNode::
345345
generate() {
346-
PStatTimer timer(text_generate_collector);
346+
PStatTimer timer(_text_generate_pcollector);
347347
if (text_cat.is_debug()) {
348348
text_cat.debug()
349349
<< "Rebuilding " << get_type() << " " << get_name()

panda/src/text/textNode.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,8 @@ class EXPCL_PANDA_TEXT TextNode : public PandaNode, public TextEncoder, public T
322322
int _num_rows;
323323
wstring _wordwrapped_wtext;
324324

325+
static PStatCollector _text_generate_pcollector;
326+
325327
public:
326328
static TypeHandle get_class_type() {
327329
return _type_handle;

0 commit comments

Comments
 (0)