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

Side by Side Diff: third_party/tcmalloc/chromium/src/gperftools/custom_allocator.h

Issue 986503002: components/metrics: Add runtime memory leak detector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: LeakDetectorImpl stores addrs as uintptr_t; Implement move semantics for RankedList Created 5 years, 3 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 2015 The Chromium 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 CUSTOM_ALLOCATOR_H_
6 #define CUSTOM_ALLOCATOR_H_
7
8 #include <stddef.h>
9
10 // PERFTOOLS_DLL_DECL is unnecessary, as it is Windows specific.
11
12 // A container class for using LowLevelAlloc with STL_Allocator. The functions
13 // Allocate() and Free() must match the specificiations in STL_Allocator.
14 class CustomAllocator {
15 public:
16 // This is a stateless class, but there is static data within the module that
17 // needs to be created and deleted.
18 static void Initialize();
19 static bool Shutdown();
20 static bool IsInitialized();
21
22 // Special initialization for unit testing. Uses new/delete for allocations.
23 static void InitializeForUnitTest();
24
25 static void* Allocate(size_t size);
26 static void Free(void* ptr, size_t size);
27 };
28
29 #endif // CUSTOM_ALLOCATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698