| Index: base/lazy_instance.h
|
| ===================================================================
|
| --- base/lazy_instance.h (revision 106713)
|
| +++ base/lazy_instance.h (working copy)
|
| @@ -41,6 +41,7 @@
|
| #include "base/atomicops.h"
|
| #include "base/base_export.h"
|
| #include "base/basictypes.h"
|
| +#include "base/logging.h"
|
| #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
|
| #include "base/threading/thread_restrictions.h"
|
|
|
| @@ -51,6 +52,7 @@
|
| static const bool kAllowedToAccessOnNonjoinableThread = false;
|
|
|
| static Type* New(void* instance) {
|
| + DCHECK_ALIGNED(instance) << ": Bad boy, the buffer is not aligned!";
|
| // Use placement new to initialize our instance in our preallocated space.
|
| // The parenthesis is very important here to force POD type initialization.
|
| return new (instance) Type();
|
| @@ -186,8 +188,8 @@
|
| base::subtle::Release_Store(&me->state_, STATE_EMPTY);
|
| }
|
|
|
| + Type *instance_;
|
| int8 buf_[sizeof(Type)]; // Preallocate the space for the Type instance.
|
| - Type *instance_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(LazyInstance);
|
| };
|
|
|