MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / recycle

Method recycle

src/common/image/image_reader.cpp:252–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252void ImageMemoryPool::recycle(bytes&& block) {
253 const size_t size = block.size();
254 if (size == 0 || !block.is_owner()) {
255 return;
256 }
257
258 const size_t bucket_size = bucket_size_for_image(size);
259
260 std::lock_guard<std::mutex> lock(mutex_);
261 auto& bucket = free_lists_[bucket_size];
262 if (bucket.size() >= max_cached_per_size_) {
263 return;
264 }
265 bucket.push_back(std::move(block));
266}
267
268ImageReader::ImageReader(size_t max_cached_per_size)
269 : memory_pool_(max_cached_per_size) {

Callers 13

decode_bytesMethod · 0.80
resize_imageMethod · 0.80
load_imageMethod · 0.80
load_image_base64Method · 0.80
preprocess_imageMethod · 0.80
load_imageMethod · 0.80
load_image_base64Method · 0.80
load_imageMethod · 0.80
load_image_base64Method · 0.80
load_imageMethod · 0.80
load_image_base64Method · 0.80
load_imageMethod · 0.80

Calls 4

bucket_size_for_imageFunction · 0.85
is_ownerMethod · 0.80
push_backMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected