MCPcopy Create free account
hub / github.com/comaps/comaps / GetMemoryRegionForTag

Function GetMemoryRegionForTag

libs/indexer/rank_table.cpp:32–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30size_t constexpr kHeaderSize = 8;
31
32unique_ptr<CopiedMemoryRegion> GetMemoryRegionForTag(FilesContainerR const & rcont, FilesContainerBase::Tag const & tag)
33{
34 if (!rcont.IsExist(tag))
35 return {};
36
37 FilesContainerR::TReader reader = rcont.GetReader(tag);
38 vector<uint8_t> buffer(static_cast<size_t>(reader.Size()));
39 reader.Read(0, buffer.data(), buffer.size());
40 return make_unique<CopiedMemoryRegion>(std::move(buffer));
41}
42
43unique_ptr<MappedMemoryRegion> GetMemoryRegionForTag(FilesMappingContainer const & mcont,
44 FilesContainerBase::Tag const & tag)

Callers 1

LoadMethod · 0.85

Calls 7

IsExistMethod · 0.80
GetReaderMethod · 0.45
SizeMethod · 0.45
ReadMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
MapMethod · 0.45

Tested by

no test coverage detected