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

Side by Side Diff: src/lazy-instance.h

Issue 9960006: Fix broken build on Windows due to r11198. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/platform-win32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 private: 184 private:
185 static void InitInstance(StorageType* storage) { 185 static void InitInstance(StorageType* storage) {
186 AllocationTrait::template InitStorageUsingTrait<CreateTrait>(storage); 186 AllocationTrait::template InitStorageUsingTrait<CreateTrait>(storage);
187 } 187 }
188 188
189 void Init() const { 189 void Init() const {
190 InitOnceTrait::Init( 190 InitOnceTrait::Init(
191 &once_, 191 &once_,
192 // Casts to void* are needed here to avoid breaking strict aliasing 192 // Casts to void* are needed here to avoid breaking strict aliasing
193 // rules. 193 // rules.
194 reinterpret_cast<void (*)(void*)>(&InitInstance), 194 reinterpret_cast<void(*)(void*)>(&InitInstance), // NOLINT
195 reinterpret_cast<void*>(&storage_)); 195 reinterpret_cast<void*>(&storage_));
196 } 196 }
197 197
198 public: 198 public:
199 T* Pointer() { 199 T* Pointer() {
200 Init(); 200 Init();
201 return AllocationTrait::MutableInstance(&storage_); 201 return AllocationTrait::MutableInstance(&storage_);
202 } 202 }
203 203
204 const T& Get() const { 204 const T& Get() const {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 typename InitOnceTrait = SingleThreadInitOnceTrait, 239 typename InitOnceTrait = SingleThreadInitOnceTrait,
240 typename DestroyTrait = LeakyInstanceTrait<T> > 240 typename DestroyTrait = LeakyInstanceTrait<T> >
241 struct LazyDynamicInstance { 241 struct LazyDynamicInstance {
242 typedef LazyInstanceImpl<T, DynamicallyAllocatedInstanceTrait<T>, 242 typedef LazyInstanceImpl<T, DynamicallyAllocatedInstanceTrait<T>,
243 CreateTrait, InitOnceTrait, DestroyTrait> type; 243 CreateTrait, InitOnceTrait, DestroyTrait> type;
244 }; 244 };
245 245
246 } } // namespace v8::internal 246 } } // namespace v8::internal
247 247
248 #endif // V8_LAZY_INSTANCE_H_ 248 #endif // V8_LAZY_INSTANCE_H_
OLDNEW
« no previous file with comments | « no previous file | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698