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

Side by Side Diff: src/LinuxMallocProfiling.h

Issue 1781213002: Add malloc/new profiling on linux (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review fixes. Created 4 years, 9 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 //===--- subzero/src/LinuxMallocProfiling.h - malloc/new tracing ---------===//
2 //
3 // The Subzero Code Generator
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// \brief malloc/new/...caller tracing.
12 ///
13 //===----------------------------------------------------------------------===//
John 2016/03/15 15:19:06 you're missing the #ifndef LINUXMALLOCPROFILING_H
sehr 2016/03/17 16:47:14 Done.
14
15 #include "IceDefs.h"
16 #include "IceTypes.h"
17
18 #include <iostream>
19
20 namespace Ice {
21
22 class LinuxMallocProfiling {
23 public:
Jim Stichnoth 2016/03/15 15:36:50 This doesn't look like normal clang-format indenta
sehr 2016/03/17 16:47:14 Done.
24 explicit LinuxMallocProfiling(size_t NumThreads) {
John 2016/03/15 15:19:06 can you move the definitions to the .cpp file so t
sehr 2016/03/17 16:47:14 Done.
25 if (NumThreads != 0) {
26 #ifdef ALLOW_LINUX_MALLOC_PROFILE
27 std::cout << "NOTE: Malloc profiling is not thread safe. "
28 << "Use --threads=0 to enable.\n";
29 #endif // ALLOW_LINUX_MALLOC_PROFILE
30 return;
31 }
32 start();
33 }
34 ~LinuxMallocProfiling() {
35 end();
36 }
37
38 private:
39 LinuxMallocProfiling(const LinuxMallocProfiling&) = delete;
John 2016/03/15 15:19:06 I honestly believe this is the proper place for de
sehr 2016/03/17 16:47:14 Done.
40 LinuxMallocProfiling &operator=(const LinuxMallocProfiling&) = delete;
41 static void start();
John 2016/03/15 15:19:06 if you move the ctor/dtor implementation to the .c
sehr 2016/03/17 16:47:14 Done.
42 static void end();
43 };
44
45 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698