Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1685)

Unified Diff: gpu/command_buffer/client/mapped_memory.h

Issue 8369010: Add GLES2Implemention::FreeUnusedSharedMemory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/client/mapped_memory.h
diff --git a/gpu/command_buffer/client/mapped_memory.h b/gpu/command_buffer/client/mapped_memory.h
index f5f3e379d3d13ad2e311310b34e9d1c243844d51..b78c29370d90e32248bccbcf23f2446a31b75536 100644
--- a/gpu/command_buffer/client/mapped_memory.h
+++ b/gpu/command_buffer/client/mapped_memory.h
@@ -90,6 +90,11 @@ class MemoryChunk {
pointer < reinterpret_cast<const int8*>(shm_.ptr) + shm_.size;
}
+ // Returns true of any memory in this chuck is in use.
+ bool InUse() {
+ return allocator_.InUse();
+ }
+
private:
int32 shm_id_;
gpu::Buffer shm_;
@@ -129,6 +134,14 @@ class MappedMemoryManager {
// token: the token value to wait for before re-using the memory.
void FreePendingToken(void* pointer, int32 token);
+ // Free Any Shared memory that is not in use.
+ void FreeUnused();
+
+ // Used for testing
+ size_t num_chunks() {
+ return chunks_.size();
+ }
+
private:
typedef std::vector<MemoryChunk*> MemoryChunkVector;
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_unittest.cc ('k') | gpu/command_buffer/client/mapped_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698