Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
005da00f
Commit
005da00f
authored
14 years ago
by
Merov Linden
Browse files
Options
Downloads
Patches
Plain Diff
STORM-1059 : Fix for cache purging (fix by Aleric)
parent
1426765e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/contributions.txt
+2
-1
2 additions, 1 deletion
doc/contributions.txt
indra/newview/lltexturecache.cpp
+9
-10
9 additions, 10 deletions
indra/newview/lltexturecache.cpp
with
11 additions
and
11 deletions
doc/contributions.txt
+
2
−
1
View file @
005da00f
...
@@ -84,7 +84,8 @@ Aleric Inglewood
...
@@ -84,7 +84,8 @@ Aleric Inglewood
VWR-24315
VWR-24315
VWR-24317
VWR-24317
VWR-24320
VWR-24320
VWR-24321
VWR-24321
VWR-24337
VWR-24354
VWR-24354
VWR-24366
VWR-24366
VWR-24519
VWR-24519
...
...
This diff is collapsed.
Click to expand it.
indra/newview/lltexturecache.cpp
+
9
−
10
View file @
005da00f
...
@@ -1419,22 +1419,21 @@ void LLTextureCache::readHeaderCache()
...
@@ -1419,22 +1419,21 @@ void LLTextureCache::readHeaderCache()
}
}
}
}
}
}
if
(
num_entries
>
sCacheMaxEntries
)
if
(
num_entries
-
empty_entries
>
sCacheMaxEntries
)
{
{
// Special case: cache size was reduced, need to remove entries
// Special case: cache size was reduced, need to remove entries
// Note: After we prune entries, we will call this again and create the LRU
// Note: After we prune entries, we will call this again and create the LRU
U32
entries_to_purge
=
(
num_entries
-
empty_entries
)
-
sCacheMaxEntries
;
U32
entries_to_purge
=
(
num_entries
-
empty_entries
)
-
sCacheMaxEntries
;
llinfos
<<
"Texture Cache Entries: "
<<
num_entries
<<
" Max: "
<<
sCacheMaxEntries
<<
" Empty: "
<<
empty_entries
<<
" Purging: "
<<
entries_to_purge
<<
llendl
;
llinfos
<<
"Texture Cache Entries: "
<<
num_entries
<<
" Max: "
<<
sCacheMaxEntries
<<
" Empty: "
<<
empty_entries
<<
" Purging: "
<<
entries_to_purge
<<
llendl
;
if
(
entries_to_purge
>
0
)
// We can exit the following loop with the given condition, since if we'd reach the end of the lru set we'd have:
// purge_list.size() = lru.size() = num_entries - empty_entries = entries_to_purge + sCacheMaxEntries >= entries_to_purge
// So, it's certain that iter will never reach lru.end() first.
std
::
set
<
lru_data_t
>::
iterator
iter
=
lru
.
begin
();
while
(
purge_list
.
size
()
<
entries_to_purge
)
{
{
for
(
std
::
set
<
lru_data_t
>::
iterator
iter
=
lru
.
begin
();
iter
!=
lru
.
end
();
++
iter
)
purge_list
.
insert
(
iter
->
second
);
{
++
iter
;
purge_list
.
insert
(
iter
->
second
);
if
(
purge_list
.
size
()
>=
entries_to_purge
)
break
;
}
}
}
llassert_always
(
purge_list
.
size
()
>=
entries_to_purge
);
}
}
else
else
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment