MCPcopy Create free account
hub / github.com/creatale/node-dv / UnCache

Method UnCache

deps/tesseract/ccstruct/imagedata.cpp:491–501  ·  view source on GitHub ↗

Removes all pages from memory and frees the memory, but does not forget the document metadata.

Source from the content-addressed store, hash-verified

489// Removes all pages from memory and frees the memory, but does not forget
490// the document metadata.
491inT64 DocumentData::UnCache() {
492 SVAutoLock lock(&pages_mutex_);
493 inT64 memory_saved = memory_used();
494 pages_.clear();
495 pages_offset_ = -1;
496 set_total_pages(-1);
497 set_memory_used(0);
498 tprintf("Unloaded document %s, saving %d memory\n", document_name_.string(),
499 memory_saved);
500 return memory_saved;
501}
502
503// Locks the pages_mutex_ and Loads as many pages can fit in max_memory_
504// starting at index pages_offset_.

Callers 1

GetPageSequentialMethod · 0.80

Calls 2

clearMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected