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

Side by Side Diff: src/base/free_deleter.h

Issue 2248393002: Replace DumpBacktrace with Chromium's StackTrace implementation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix mac Created 4 years, 4 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
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_MEMORY_FREE_DELETER_H_
Michael Starzinger 2016/08/18 10:39:19 nit: V8_BASE_FREE_DELETER_H_
rmcilroy 2016/08/18 11:39:48 Done.
6 #define BASE_MEMORY_FREE_DELETER_H_
7
8 #include <stdlib.h>
9
10 namespace v8 {
11 namespace base {
12
13 // Function object which invokes 'free' on its parameter, which must be
14 // a pointer. Can be used to store malloc-allocated pointers in std::unique_ptr:
15 //
16 // std::unique_ptr<int, base::FreeDeleter> foo_ptr(
17 // static_cast<int*>(malloc(sizeof(int))));
18 struct FreeDeleter {
19 inline void operator()(void* ptr) const { free(ptr); }
20 };
21
22 } // namespace base
23 } // namespace v8
24
25 #endif // BASE_MEMORY_FREE_DELETER_H_
Michael Starzinger 2016/08/18 10:39:19 nit: V8_BASE_FREE_DELETER_H_
rmcilroy 2016/08/18 11:39:48 Done.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698