What to call objects that may delete cached data to meet memory constraints?

Posted by Brent on Programmers See other posts from Programmers or by Brent
Published on 2013-06-28T22:16:35Z Indexed on 2013/06/28 22:27 UTC
Read the original article Hit count: 344

Filed under:

I'm developing some cross-platform software which is intended to run on mobile devices. Both iOS and Android provide low memory warnings. I plan to make a wrapper class that will free cached resources (like textures) when low memory warnings are issued (assuming the resource is not in use). If the resource returns to use, it'll re-cache it, etc... I'm trying to think of what this is called. In .Net, it's similar to a "weak reference" but that only really makes sense when dealing with garbage collection, and since I'm using c++ and shared_ptr, a weak reference already has a meaning which is distinct from the one I'm thinking of. There's also the difference that this class will be able to rebuild the cache when needed. What is this pattern/whatever is called?

Edit: Feel free to recommend tags for this question.

© Programmers or respective owner

Related posts about cache