MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Retrieve

Method Retrieve

Source/ThirdParty/tracy/client/TracyKCore.cpp:103–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void* KCore::Retrieve( uint64_t addr, uint64_t size ) const
104{
105 if( m_fd == -1 ) return nullptr;
106 auto it = std::lower_bound( m_offsets.begin(), m_offsets.end(), addr, []( const Offset& lhs, uint64_t rhs ) { return lhs.start + lhs.size < rhs; } );
107 if( it == m_offsets.end() ) return nullptr;
108 if( addr + size > it->start + it->size ) return nullptr;
109 if( lseek( m_fd, it->offset + addr - it->start, SEEK_SET ) == -1 ) return nullptr;
110 auto ptr = tracy_malloc( size );
111 if( read( m_fd, ptr, size ) != ssize_t( size ) )
112 {
113 tracy_free( ptr );
114 return nullptr;
115 }
116 return ptr;
117}
118
119}
120

Callers 1

HandleSymbolQueueItemMethod · 0.80

Calls 5

tracy_mallocFunction · 0.85
readFunction · 0.85
tracy_freeFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected