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

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

Issue 23130004: Enforce a memory limit on MappedMemoryManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix another namespace error Created 7 years, 4 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
« no previous file with comments | « gpu/command_buffer/client/buffer_tracker_unittest.cc ('k') | gpu/command_buffer/client/fenced_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/fenced_allocator.h
diff --git a/gpu/command_buffer/client/fenced_allocator.h b/gpu/command_buffer/client/fenced_allocator.h
index 90288d9fb8fb5e79ae68d72e13de20b790d5d7b9..71e6178e8322d53cd75a6c0bdea147c2708d068c 100644
--- a/gpu/command_buffer/client/fenced_allocator.h
+++ b/gpu/command_buffer/client/fenced_allocator.h
@@ -83,6 +83,9 @@ class GPU_EXPORT FencedAllocator {
// True if any memory is allocated.
bool InUse();
+ // Return bytes of memory that is IN_USE
+ size_t bytes_in_use() const { return bytes_in_use_; }
+
private:
// Status of a block of memory, for book-keeping.
enum State {
@@ -134,6 +137,7 @@ class GPU_EXPORT FencedAllocator {
CommandBufferHelper *helper_;
Container blocks_;
+ size_t bytes_in_use_;
DISALLOW_IMPLICIT_CONSTRUCTORS(FencedAllocator);
};
@@ -243,6 +247,8 @@ class FencedAllocatorWrapper {
FencedAllocator &allocator() { return allocator_; }
+ size_t bytes_in_use() const { return allocator_.bytes_in_use(); }
+
private:
FencedAllocator allocator_;
void* base_;
« no previous file with comments | « gpu/command_buffer/client/buffer_tracker_unittest.cc ('k') | gpu/command_buffer/client/fenced_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698