Speed up texture cache init. (Was exceptionally slow with a debugger attached)
This commit is contained in:
@@ -1305,14 +1305,12 @@ void LLTextureCache::writeEntriesAndClose(const std::vector<Entry>& entries)
|
||||
if (!mReadOnly)
|
||||
{
|
||||
LLAPRFile* aprfile = openHeaderEntriesFile(false, (S32)sizeof(EntriesInfo));
|
||||
for (S32 idx=0; idx<num_entries; idx++)
|
||||
U64 write_size = U64(sizeof(Entry)) * num_entries;
|
||||
U64 bytes_written = aprfile->write((void*)(entries.data()), write_size);
|
||||
if (bytes_written != write_size)
|
||||
{
|
||||
S32 bytes_written = aprfile->write((void*)(&entries[idx]), (S32)sizeof(Entry));
|
||||
if(bytes_written != sizeof(Entry))
|
||||
{
|
||||
clearCorruptedCache(); //clear the cache.
|
||||
return;
|
||||
}
|
||||
clearCorruptedCache(); //clear the cache.
|
||||
return;
|
||||
}
|
||||
closeHeaderEntriesFile();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user