Home | History | Annotate | Download | only in base

Lines Matching refs:instance

5 // The LazyInstance<Type, Traits> class manages a single instance of Type,
10 // and Pointer() will always return the same, completely initialized instance.
11 // When the instance is constructed it is registered with AtExitManager. The
21 // will manage a unique instance. It also preallocates the space for Type, as
22 // to avoid allocating the Type instance on the heap. This may help with the
23 // performance of creating the instance, and reducing heap fragmentation. This
53 static Type* New(void* instance) {
54 // Use placement new to initialize our instance in our preallocated space.
56 return new (instance) Type();
58 static void Delete(void* instance) {
60 reinterpret_cast<Type*>(instance)->~Type();
68 static Type* New(void* instance) {
69 return DefaultLazyInstanceTraits<Type>::New(instance);
76 static void (*Delete)(void* instance);
80 void (*LeakyLazyInstanceTraits<Type>::Delete)(void* instance) = NULL;
96 // Check if instance needs to be created. If so return true otherwise
97 // if another thread has beat us, wait for instance to be created and
101 // After creating an instance, call this to register the dtor to be called
103 void CompleteInstance(void* instance, void (*dtor)(void*));
111 // Allow preservation of object alignment in the lazy instance when using GCC.
134 // We will hopefully have fast access when the instance is already created.
137 // Create the instance in the space provided by |buf_|.
169 // Calling OnExit while the instance is in use by other threads is a mistake.
178 // Preallocate the space for the Type instance, and preserve alignment.