MCPcopy Create free account
hub / github.com/deepseek-ai/3FS / put

Method put

src/common/utils/ObjectPool.h:67–82  ·  view source on GitHub ↗

put a object into thread local cache or global cache.

Source from the content-addressed store, hash-verified

65
66 // put a object into thread local cache or global cache.
67 void put(std::unique_ptr<Storage> obj) {
68 // push to the first batch.
69 if (first_.size() < kThreadLocalMaxNum) {
70 first_.push_back(std::move(obj));
71 return;
72 }
73
74 // push to the second batch.
75 second_.push_back(std::move(obj));
76 if (UNLIKELY(second_.size() >= kThreadLocalMaxNum)) {
77 // push to the global cache.
78 parent_.putBatch(std::move(second_));
79 second_.clear();
80 second_.reserve(kThreadLocalMaxNum);
81 }
82 }
83
84 private:
85 ObjectPool &parent_;

Callers 6

packUidFunction · 0.45
Toml.hppFile · 0.45
Nameof.hppFile · 0.45
serRawArgsMethod · 0.45
MagicEnum.hppFile · 0.45
operator()Method · 0.45

Calls 5

push_backMethod · 0.80
putBatchMethod · 0.80
sizeMethod · 0.45
clearMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected