Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Free resources from the texture cache as appropriate. #151

Merged
merged 1 commit into from Jan 26, 2016

Conversation

@pcwalton
Copy link
Collaborator

pcwalton commented Jan 26, 2016

For now, this just unconditionally frees unused resources from the
previous frame after building a new frame. We may want to throttle this
back at some point.

Also, the cache used is potentially inefficient and can be easily
improved.

We don't free texture pages at the GL level yet.

@@ -86,11 +86,12 @@ impl<T: FreeListItem> FreeList<T> {

// TODO(gw): Actually free items from the texture cache!!
#[allow(dead_code)]
pub fn free(&mut self, id: FreeListItemId) {
pub fn free(&mut self, id: FreeListItemId) -> &mut T {

This comment has been minimized.

@glennw

glennw Jan 26, 2016

Member

It's not safe to do this - the linked list of free items are stored inside the freed items themselves (for memory / perf reasons), so you can't reference the item after it's freed. Can you change the calling code to get the item first, extract the needed data and then free the item?

@pcwalton pcwalton force-pushed the pcwalton:texture-cache-freeing branch from 36aaaac to 1ec4e58 Jan 26, 2016
glennw added a commit that referenced this pull request Jan 26, 2016
Free resources from the texture cache as appropriate.
@glennw glennw merged commit c0fd32a into servo:master Jan 26, 2016
For now, this just unconditionally frees unused resources from the
previous frame after building a new frame. We may want to throttle this
back at some point.

Also, the cache used is potentially inefficient and can be easily
improved.

We don't free texture pages at the GL level yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.