| Index: base/stack_container.h
|
| ===================================================================
|
| --- base/stack_container.h (revision 3911)
|
| +++ base/stack_container.h (working copy)
|
| @@ -9,6 +9,7 @@
|
| #include <vector>
|
|
|
| #include "base/basictypes.h"
|
| +#include "base/thread_collision_warner.h"
|
|
|
| // This allocator can be used with STL containers to provide a stack buffer
|
| // from which to allocate memory and overflows onto the heap. This stack buffer
|
| @@ -152,8 +153,14 @@
|
| // Support operator-> to get to the container. This allows nicer syntax like:
|
| // StackContainer<...> foo;
|
| // std::sort(foo->begin(), foo->end());
|
| - ContainerType* operator->() { return &container_; }
|
| - const ContainerType* operator->() const { return &container_; }
|
| + ContainerType* operator->() {
|
| + D_BOOK_CRITICAL_SECTION(arrow_operator_);
|
| + return &container_;
|
| + }
|
| + const ContainerType* operator->() const {
|
| + D_BOOK_CRITICAL_SECTION(arrow_operator_);
|
| + return &container_;
|
| + }
|
|
|
| #ifdef UNIT_TEST
|
| // Retrieves the stack source so that that unit tests can verify that the
|
| @@ -168,6 +175,8 @@
|
| Allocator allocator_;
|
| ContainerType container_;
|
|
|
| + D_DEFINE_CRITICAL_SECTION(arrow_operator_);
|
| +
|
| DISALLOW_EVIL_CONSTRUCTORS(StackContainer);
|
| };
|
|
|
|
|