MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / register_file_mapping

Function register_file_mapping

ogsr_engine/xrCore/FS.cpp:13–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11static std::mutex g_file_mappings_Mutex;
12
13void register_file_mapping(void* address, const u32& size, LPCSTR file_name)
14{
15 std::scoped_lock<decltype(g_file_mappings_Mutex)> lock(g_file_mappings_Mutex);
16
17 FILE_MAPPINGS::const_iterator I = g_file_mappings.find(*(u32*)&address);
18 VERIFY(I == g_file_mappings.end());
19 g_file_mappings.insert(std::make_pair(*(u32*)&address, std::make_pair(size, shared_str(file_name))));
20
21 g_file_mapped_memory += size;
22 ++g_file_mapped_count;
23}
24
25void unregister_file_mapping(void* address, const u32& size)
26{

Callers 2

CVirtualFileReaderMethod · 0.85
read_dbMethod · 0.85

Calls 4

shared_strClass · 0.85
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected