diff options
Diffstat (limited to 'linden')
-rw-r--r-- | linden/doc/contributions.txt | 2 | ||||
-rw-r--r-- | linden/indra/cmake/ViewerMiscLibs.cmake | 8 | ||||
-rw-r--r-- | linden/indra/newview/lltexturecache.cpp | 54 | ||||
-rw-r--r-- | linden/indra/newview/lltexturecache.h | 1 | ||||
-rwxr-xr-x | linden/scripts/install.py | 15 |
5 files changed, 53 insertions, 27 deletions
diff --git a/linden/doc/contributions.txt b/linden/doc/contributions.txt index cd708fd..e5e3eb0 100644 --- a/linden/doc/contributions.txt +++ b/linden/doc/contributions.txt | |||
@@ -85,6 +85,8 @@ Aleric Inglewood | |||
85 | IMP-662 | 85 | IMP-662 |
86 | IMP-663 | 86 | IMP-663 |
87 | IMP-664 | 87 | IMP-664 |
88 | IMP-667 | ||
89 | IMP-670 | ||
88 | Alissa Sabre | 90 | Alissa Sabre |
89 | VWR-81 | 91 | VWR-81 |
90 | VWR-83 | 92 | VWR-83 |
diff --git a/linden/indra/cmake/ViewerMiscLibs.cmake b/linden/indra/cmake/ViewerMiscLibs.cmake index 7fe1040..35f4e3a 100644 --- a/linden/indra/cmake/ViewerMiscLibs.cmake +++ b/linden/indra/cmake/ViewerMiscLibs.cmake | |||
@@ -8,6 +8,14 @@ if (NOT STANDALONE) | |||
8 | use_prebuilt_binary(32bitcompatibilitylibs) | 8 | use_prebuilt_binary(32bitcompatibilitylibs) |
9 | endif(LINUX AND ${ARCH} STREQUAL "x86_64") | 9 | endif(LINUX AND ${ARCH} STREQUAL "x86_64") |
10 | use_prebuilt_binary(fontconfig) | 10 | use_prebuilt_binary(fontconfig) |
11 | else (NOT STANDALONE) | ||
12 | # Download there even when using standalone. | ||
13 | set(STANDALONE OFF) | ||
14 | use_prebuilt_binary(vivox) | ||
15 | if(LINUX AND ${ARCH} STREQUAL "x86_64") | ||
16 | use_prebuilt_binary(32bitcompatibilitylibs) | ||
17 | endif(LINUX AND ${ARCH} STREQUAL "x86_64") | ||
18 | set(STANDALONE ON) | ||
11 | endif(NOT STANDALONE) | 19 | endif(NOT STANDALONE) |
12 | 20 | ||
13 | if (WINDOWS) | 21 | if (WINDOWS) |
diff --git a/linden/indra/newview/lltexturecache.cpp b/linden/indra/newview/lltexturecache.cpp index a9b7f81..a1a9a39 100644 --- a/linden/indra/newview/lltexturecache.cpp +++ b/linden/indra/newview/lltexturecache.cpp | |||
@@ -1172,7 +1172,7 @@ void LLTextureCache::readHeaderCache() | |||
1172 | U32 empty_entries = 0; | 1172 | U32 empty_entries = 0; |
1173 | typedef std::pair<U32, LLUUID> lru_data_t; | 1173 | typedef std::pair<U32, LLUUID> lru_data_t; |
1174 | std::set<lru_data_t> lru; | 1174 | std::set<lru_data_t> lru; |
1175 | std::vector<LLUUID> purge_list; | 1175 | std::set<LLUUID> purge_list; |
1176 | for (U32 i=0; i<num_entries; i++) | 1176 | for (U32 i=0; i<num_entries; i++) |
1177 | { | 1177 | { |
1178 | Entry& entry = entries[i]; | 1178 | Entry& entry = entries[i]; |
@@ -1191,27 +1191,23 @@ void LLTextureCache::readHeaderCache() | |||
1191 | { | 1191 | { |
1192 | // Shouldn't happen, failsafe only | 1192 | // Shouldn't happen, failsafe only |
1193 | llwarns << "Bad entry: " << i << ": " << entry.mID << ": BodySize: " << entry.mBodySize << llendl; | 1193 | llwarns << "Bad entry: " << i << ": " << entry.mID << ": BodySize: " << entry.mBodySize << llendl; |
1194 | purge_list.push_back(id); | 1194 | purge_list.insert(id); |
1195 | } | 1195 | } |
1196 | } | 1196 | } |
1197 | } | 1197 | } |
1198 | } | 1198 | } |
1199 | if (num_entries > sCacheMaxEntries) | 1199 | if (num_entries - empty_entries > sCacheMaxEntries) |
1200 | { | 1200 | { |
1201 | // Special case: cache size was reduced, need to remove entries | 1201 | // Special case: cache size was reduced, need to remove entries |
1202 | // Note: After we prune entries, we will call this again and create the LRU | 1202 | // Note: After we prune entries, we will call this again and create the LRU |
1203 | U32 entries_to_purge = (num_entries-empty_entries) - sCacheMaxEntries; | 1203 | U32 entries_to_purge = (num_entries - empty_entries) - sCacheMaxEntries; |
1204 | llinfos << "Texture Cache Entries: " << num_entries << " Max: " << sCacheMaxEntries << " Empty: " << empty_entries << " Purging: " << entries_to_purge << llendl; | 1204 | llinfos << "Texture Cache Entries: " << num_entries << " Max: " << sCacheMaxEntries << " Empty: " << empty_entries << " Purging: " << entries_to_purge << llendl; |
1205 | if (entries_to_purge > 0) | 1205 | // We can exit the following loop with the given condition, since if we'd reach the end of the lru set we'd have: |
1206 | // purge_list.size() = lru.size() = num_entries - empty_entries = entries_to_purge + sCacheMaxEntries >= entries_to_purge | ||
1207 | for (std::set<lru_data_t>::iterator iter = lru.begin(); purge_list.size() < entries_to_purge; ++iter) | ||
1206 | { | 1208 | { |
1207 | for (std::set<lru_data_t>::iterator iter = lru.begin(); iter != lru.end(); ++iter) | 1209 | purge_list.insert(iter->second); |
1208 | { | ||
1209 | purge_list.push_back(iter->second); | ||
1210 | if (purge_list.size() >= entries_to_purge) | ||
1211 | break; | ||
1212 | } | ||
1213 | } | 1210 | } |
1214 | llassert_always(purge_list.size() >= entries_to_purge); | ||
1215 | } | 1211 | } |
1216 | else | 1212 | else |
1217 | { | 1213 | { |
@@ -1227,11 +1223,9 @@ void LLTextureCache::readHeaderCache() | |||
1227 | 1223 | ||
1228 | if (purge_list.size() > 0) | 1224 | if (purge_list.size() > 0) |
1229 | { | 1225 | { |
1230 | for (std::vector<LLUUID>::iterator iter = purge_list.begin(); iter != purge_list.end(); ++iter) | 1226 | for (std::set<LLUUID>::iterator iter = purge_list.begin(); iter != purge_list.end(); ++iter) |
1231 | { | 1227 | { |
1232 | mHeaderMutex.unlock(); | 1228 | removeFromCacheLocked(*iter); |
1233 | removeFromCache(*iter); | ||
1234 | mHeaderMutex.lock(); | ||
1235 | } | 1229 | } |
1236 | // If we removed any entries, we need to rebuild the entries list, | 1230 | // If we removed any entries, we need to rebuild the entries list, |
1237 | // write the header, and call this again | 1231 | // write the header, and call this again |
@@ -1250,7 +1244,7 @@ void LLTextureCache::readHeaderCache() | |||
1250 | writeEntriesAndClose(new_entries); | 1244 | writeEntriesAndClose(new_entries); |
1251 | mHeaderMutex.unlock(); // unlock the mutex before calling again | 1245 | mHeaderMutex.unlock(); // unlock the mutex before calling again |
1252 | readHeaderCache(); // repeat with new entries file | 1246 | readHeaderCache(); // repeat with new entries file |
1253 | mHeaderMutex.lock(); | 1247 | return; |
1254 | } | 1248 | } |
1255 | else | 1249 | else |
1256 | { | 1250 | { |
@@ -1345,7 +1339,7 @@ void LLTextureCache::purgeTextures(bool validate) | |||
1345 | if (validate) | 1339 | if (validate) |
1346 | { | 1340 | { |
1347 | validate_idx = gSavedSettings.getU32("CacheValidateCounter"); | 1341 | validate_idx = gSavedSettings.getU32("CacheValidateCounter"); |
1348 | U32 next_idx = (++validate_idx) % 256; | 1342 | U32 next_idx = (validate_idx + 1) % 256; |
1349 | gSavedSettings.setU32("CacheValidateCounter", next_idx); | 1343 | gSavedSettings.setU32("CacheValidateCounter", next_idx); |
1350 | LL_DEBUGS("TextureCache") << "TEXTURE CACHE: Validating: " << validate_idx << LL_ENDL; | 1344 | LL_DEBUGS("TextureCache") << "TEXTURE CACHE: Validating: " << validate_idx << LL_ENDL; |
1351 | } | 1345 | } |
@@ -1388,7 +1382,15 @@ void LLTextureCache::purgeTextures(bool validate) | |||
1388 | { | 1382 | { |
1389 | purge_count++; | 1383 | purge_count++; |
1390 | LL_DEBUGS("TextureCache") << "PURGING: " << filename << LL_ENDL; | 1384 | LL_DEBUGS("TextureCache") << "PURGING: " << filename << LL_ENDL; |
1391 | LLAPRFile::remove(filename); | 1385 | if (entries[idx].mBodySize > 0) |
1386 | { | ||
1387 | LLAPRFile::remove(filename); | ||
1388 | } | ||
1389 | else if (LLAPRFile::isExist(filename)) // Sanity check. Shouldn't exist. | ||
1390 | { | ||
1391 | LL_WARNS("TextureCache") << "Entry has zero body size but existing " << filename << ". Deleting file too..." << LL_ENDL; | ||
1392 | LLAPRFile::remove(filename); | ||
1393 | } | ||
1392 | cache_size -= entries[idx].mBodySize; | 1394 | cache_size -= entries[idx].mBodySize; |
1393 | mTexturesSizeTotal -= entries[idx].mBodySize; | 1395 | mTexturesSizeTotal -= entries[idx].mBodySize; |
1394 | entries[idx].mBodySize = 0; | 1396 | entries[idx].mBodySize = 0; |
@@ -1615,7 +1617,6 @@ bool LLTextureCache::removeHeaderCacheEntry(const LLUUID& id) | |||
1615 | { | 1617 | { |
1616 | if (!mReadOnly) | 1618 | if (!mReadOnly) |
1617 | { | 1619 | { |
1618 | LLMutexLock lock(&mHeaderMutex); | ||
1619 | Entry entry; | 1620 | Entry entry; |
1620 | S32 idx = openAndReadEntry(id, entry, false); | 1621 | S32 idx = openAndReadEntry(id, entry, false); |
1621 | if (idx >= 0) | 1622 | if (idx >= 0) |
@@ -1632,17 +1633,26 @@ bool LLTextureCache::removeHeaderCacheEntry(const LLUUID& id) | |||
1632 | return false; | 1633 | return false; |
1633 | } | 1634 | } |
1634 | 1635 | ||
1635 | void LLTextureCache::removeFromCache(const LLUUID& id) | 1636 | void LLTextureCache::removeFromCacheLocked(const LLUUID& id) |
1636 | { | 1637 | { |
1637 | //llwarns << "Removing texture from cache: " << id << llendl; | 1638 | //llwarns << "Removing texture from cache: " << id << llendl; |
1638 | if (!mReadOnly) | 1639 | if (!mReadOnly) |
1639 | { | 1640 | { |
1640 | removeHeaderCacheEntry(id); | 1641 | removeHeaderCacheEntry(id); |
1641 | LLMutexLock lock(&mHeaderMutex); | ||
1642 | LLAPRFile::remove(getTextureFileName(id)); | 1642 | LLAPRFile::remove(getTextureFileName(id)); |
1643 | } | 1643 | } |
1644 | } | 1644 | } |
1645 | 1645 | ||
1646 | void LLTextureCache::removeFromCache(const LLUUID& id) | ||
1647 | { | ||
1648 | //llwarns << "Removing texture from cache: " << id << llendl; | ||
1649 | if (!mReadOnly) | ||
1650 | { | ||
1651 | LLMutexLock lock(&mHeaderMutex); | ||
1652 | LLTextureCache::removeFromCacheLocked(id); | ||
1653 | } | ||
1654 | } | ||
1655 | |||
1646 | ////////////////////////////////////////////////////////////////////////////// | 1656 | ////////////////////////////////////////////////////////////////////////////// |
1647 | 1657 | ||
1648 | LLTextureCache::ReadResponder::ReadResponder() | 1658 | LLTextureCache::ReadResponder::ReadResponder() |
diff --git a/linden/indra/newview/lltexturecache.h b/linden/indra/newview/lltexturecache.h index 45804c2..c859b9a 100644 --- a/linden/indra/newview/lltexturecache.h +++ b/linden/indra/newview/lltexturecache.h | |||
@@ -158,6 +158,7 @@ private: | |||
158 | S32 getHeaderCacheEntry(const LLUUID& id, S32& imagesize); | 158 | S32 getHeaderCacheEntry(const LLUUID& id, S32& imagesize); |
159 | S32 setHeaderCacheEntry(const LLUUID& id, S32 imagesize); | 159 | S32 setHeaderCacheEntry(const LLUUID& id, S32 imagesize); |
160 | bool removeHeaderCacheEntry(const LLUUID& id); | 160 | bool removeHeaderCacheEntry(const LLUUID& id); |
161 | void removeFromCacheLocked(const LLUUID& id); | ||
161 | 162 | ||
162 | private: | 163 | private: |
163 | // Internal | 164 | // Internal |
diff --git a/linden/scripts/install.py b/linden/scripts/install.py index a16034f..f09fc48 100755 --- a/linden/scripts/install.py +++ b/linden/scripts/install.py | |||
@@ -534,24 +534,24 @@ windows/i686/vs/2003 -- specify a windows visual studio 2003 package""" | |||
534 | platform, | 534 | platform, |
535 | cache_dir)) | 535 | cache_dir)) |
536 | to_install = [] | 536 | to_install = [] |
537 | to_uninstall = [] | ||
537 | #print "self._installed",self._installed | 538 | #print "self._installed",self._installed |
538 | for ifile in ifiles: | 539 | for ifile in ifiles: |
539 | if ifile.pkgname not in self._installed: | 540 | if ifile.pkgname not in self._installed: |
540 | to_install.append(ifile) | 541 | to_install.append(ifile) |
541 | elif ifile.url not in self._installed[ifile.pkgname].urls(): | 542 | elif ifile.url not in self._installed[ifile.pkgname].urls(): |
543 | to_uninstall.append(ifile.pkgname) | ||
542 | to_install.append(ifile) | 544 | to_install.append(ifile) |
543 | elif ifile.md5sum != \ | 545 | elif ifile.md5sum != \ |
544 | self._installed[ifile.pkgname].get_md5sum(ifile.url): | 546 | self._installed[ifile.pkgname].get_md5sum(ifile.url): |
545 | # *TODO: We may want to uninstall the old version too | 547 | to_uninstall.append(ifile.pkgname) |
546 | # when we detect it is installed, but the md5 sum is | ||
547 | # different. | ||
548 | to_install.append(ifile) | 548 | to_install.append(ifile) |
549 | else: | 549 | else: |
550 | #print "Installation up to date:", | 550 | #print "Installation up to date:", |
551 | # ifile.pkgname,ifile.platform_path | 551 | # ifile.pkgname,ifile.platform_path |
552 | pass | 552 | pass |
553 | #print "to_install",to_install | 553 | #print "to_install",to_install |
554 | return to_install | 554 | return [to_install, to_uninstall] |
555 | 555 | ||
556 | def _install(self, to_install, install_dir): | 556 | def _install(self, to_install, install_dir): |
557 | for ifile in to_install: | 557 | for ifile in to_install: |
@@ -620,12 +620,17 @@ windows/i686/vs/2003 -- specify a windows visual studio 2003 package""" | |||
620 | cache_dir = os.path.realpath(cache_dir) | 620 | cache_dir = os.path.realpath(cache_dir) |
621 | _mkdir(install_dir) | 621 | _mkdir(install_dir) |
622 | _mkdir(cache_dir) | 622 | _mkdir(cache_dir) |
623 | to_install = self._build_ifiles(platform, cache_dir) | 623 | to_install_uninstall = self._build_ifiles(platform, cache_dir) |
624 | to_install = to_install_uninstall[0] | ||
625 | to_uninstall = to_install_uninstall[1] | ||
624 | 626 | ||
625 | # Filter for files which we actually requested to install. | 627 | # Filter for files which we actually requested to install. |
626 | to_install = [ifl for ifl in to_install if ifl.pkgname in installables] | 628 | to_install = [ifl for ifl in to_install if ifl.pkgname in installables] |
629 | to_uninstall = [ifl for ifl in to_uninstall if ifl in installables] | ||
627 | for ifile in to_install: | 630 | for ifile in to_install: |
628 | ifile.fetch_local() | 631 | ifile.fetch_local() |
632 | if to_uninstall: | ||
633 | self.uninstall(to_uninstall, install_dir) | ||
629 | self._install(to_install, install_dir) | 634 | self._install(to_install, install_dir) |
630 | 635 | ||
631 | def do_install(self, installables, platform, install_dir, cache_dir=None, | 636 | def do_install(self, installables, platform, install_dir, cache_dir=None, |