| 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;
|
|
|
|
|