MCPcopy Create free account
hub / github.com/dmlc/xgboost / ClearExcess

Method ClearExcess

include/xgboost/cache.h:102–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100 }
101
102 void ClearExcess() {
103 this->CheckConsistent();
104 // clear half of the entries to prevent repeatingly clearing cache.
105 std::size_t half_size = max_size_ / 2;
106 while (queue_.size() >= half_size && !queue_.empty()) {
107 auto p_fmat = queue_.front();
108 queue_.pop();
109 container_.erase(p_fmat);
110 }
111 this->CheckConsistent();
112 }
113
114 public:
115 /**

Callers 1

CacheItemMethod · 0.95

Calls 3

CheckConsistentMethod · 0.95
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected