33 record(
Thread *current_thread) {
34 nassertr(_next ==
nullptr && _prev ==
nullptr,
nullptr);
40 if (gobj_cat.is_debug()) {
42 <<
"recording cache entry: " << *
this <<
", total_size = " 43 << cache_mgr->_total_size + 1 <<
"\n";
46 insert_before(cache_mgr->_list);
47 ++cache_mgr->_total_size;
48 cache_mgr->_geom_cache_size_pcollector.set_level(cache_mgr->_total_size);
49 cache_mgr->_geom_cache_record_pcollector.add_level(1);
53 GeomCacheManager::_geom_cache_active_pcollector.add_level(1);
75 nassertv(_next !=
nullptr && _prev !=
nullptr);
78 insert_before(cache_mgr->_list);
82 if (_last_frame_used != current_frame) {
83 GeomCacheManager::_geom_cache_active_pcollector.add_level(1);
87 _last_frame_used = current_frame;
96 nassertr(_next !=
nullptr && _prev !=
nullptr,
nullptr);
99 keepme.cheat() =
this;
101 if (gobj_cat.is_debug()) {
103 <<
"remove_entry(" << *
this <<
")\n";
110 --cache_mgr->_total_size;
111 cache_mgr->_geom_cache_size_pcollector.set_level(cache_mgr->_total_size);
112 cache_mgr->_geom_cache_erase_pcollector.add_level(1);
116 if (_last_frame_used == current_frame) {
117 GeomCacheManager::_geom_cache_active_pcollector.sub_level(1);
135 void GeomCacheEntry::
136 output(std::ostream &out)
const {
137 out <<
"[ unknown ]";
static ClockObject * get_global_clock()
Returns a pointer to the global ClockObject.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_frame_count
Returns the number of times tick() has been called since the ClockObject was created,...
Similar to MutexHolder, but for a light mutex.
This is used to keep track of, and limit the size of, the cache of munged vertices,...
virtual void evict_callback()
Called when the entry is evicted from the cache, this should clean up the owning object appropriately...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void ref() const
Explicitly increments the reference count.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void refresh(Thread *current_thread)
Marks the cache entry recently used, so it will not be evicted for a while.
void evict_old_entries()
Trims the cache size down to get_max_size() by evicting old cache entries as needed.
A thread; that is, a lightweight process.
static bool is_connected()
Returns true if the client believes it is connected to a working PStatServer, false otherwise.
PT(GeomCacheEntry) GeomCacheEntry
Records the entry in the global cache for the first time.
This object contains a single cache entry in the GeomCacheManager.
TypeHandle is the identifier used to differentiate C++ class types.
static GeomCacheManager * get_global_ptr()
Returns the global cache manager pointer.