Don't depend on View in Worker.

This commit is contained in:
Bartosz Taudul 2020-05-23 15:53:18 +02:00
parent 2f35c785ee
commit 18b2e3e5be
3 changed files with 11 additions and 12 deletions

View File

@ -15,14 +15,4 @@ bool SourceFileValid( const char* fn, uint64_t olderThan, const View& view, cons
return false;
}
bool SourceFileValid( const char* fn, uint64_t olderThan )
{
struct stat buf;
if( stat( fn, &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0 )
{
return (uint64_t)buf.st_mtime < olderThan;
}
return false;
}
}

View File

@ -17,7 +17,6 @@ static inline bool FileExists( const char* fn )
}
bool SourceFileValid( const char* fn, uint64_t olderThan, const View& view, const Worker& worker );
bool SourceFileValid( const char* fn, uint64_t olderThan );
}

View File

@ -16,13 +16,13 @@
# define __STDC_FORMAT_MACROS
#endif
#include <inttypes.h>
#include <sys/stat.h>
#include <capstone/capstone.h>
#include "../common/TracyProtocol.hpp"
#include "../common/TracySystem.hpp"
#include "TracyFileRead.hpp"
#include "TracyFilesystem.hpp"
#include "TracyFileWrite.hpp"
#include "TracySort.hpp"
#include "TracyTaskDispatch.hpp"
@ -44,6 +44,16 @@ static tracy_force_inline uint32_t UnpackFileLine( uint64_t packed, uint32_t& li
return packed >> 32;
}
static bool SourceFileValid( const char* fn, uint64_t olderThan )
{
struct stat buf;
if( stat( fn, &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0 )
{
return (uint64_t)buf.st_mtime < olderThan;
}
return false;
}
static const uint8_t FileHeader[8] { 't', 'r', 'a', 'c', 'y', Version::Major, Version::Minor, Version::Patch };
enum { FileHeaderMagic = 5 };