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 bb5c55170ab25e2766a4804c762a51ee00e8c2f3..55adea888bfa2a62a28948345bf01016f3ada7bc 100644 |
--- a/gpu/command_buffer/client/fenced_allocator.h |
+++ b/gpu/command_buffer/client/fenced_allocator.h |
@@ -65,6 +65,8 @@ class GPU_EXPORT FencedAllocator { |
// token: the token value to wait for before re-using the memory. |
void FreePendingToken(Offset offset, int32 token); |
+ void FreePendingSerial(Offset offset, uint32 token); |
+ |
// Frees any blocks pending a token for which the token has been read. |
void FreeUnused(); |
@@ -91,7 +93,8 @@ class GPU_EXPORT FencedAllocator { |
enum State { |
IN_USE, |
FREE, |
- FREE_PENDING_TOKEN |
+ FREE_PENDING_TOKEN, |
+ FREE_PENDING_SERIAL |
}; |
// Book-keeping sturcture that describes a block of memory. |
@@ -100,6 +103,7 @@ class GPU_EXPORT FencedAllocator { |
Offset offset; |
unsigned int size; |
int32 token; // token to wait for in the FREE_PENDING_TOKEN case. |
+ uint32 serial; |
}; |
// Comparison functor for memory block sorting. |
@@ -114,6 +118,7 @@ class GPU_EXPORT FencedAllocator { |
typedef unsigned int BlockIndex; |
static const int32 kUnusedToken = 0; |
+ static const uint32 kUnusedSerial = 0; |
// Gets the index of a memory block, given its offset. |
BlockIndex GetBlockByOffset(Offset offset); |
@@ -202,6 +207,11 @@ class FencedAllocatorWrapper { |
allocator_.FreePendingToken(GetOffset(pointer), token); |
} |
+ void FreePendingSerial(void *pointer, uint32 serial) { |
+ DCHECK(pointer); |
+ allocator_.FreePendingSerial(GetOffset(pointer), serial); |
+ } |
+ |
// Frees any blocks pending a token for which the token has been read. |
void FreeUnused() { |
allocator_.FreeUnused(); |