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

Side by Side Diff: third_party/tcmalloc/chromium/src/base/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: Remove Author label from new files; Check type in LeakDetectorValueType comparators; Add missing fi… Created 5 years, 5 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 (c) 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 // ---
6 // Author: Simon Que
7
8 #ifndef BASE_CUSTOM_ALLOCATOR_H_
9 #define BASE_CUSTOM_ALLOCATOR_H_
10
11 #include <stddef.h>
12
13 #include "base/low_level_alloc.h"
14
15 // A container class for using LowLevelAlloc with STL_Allocator. The functions
16 // Allocate() and Free() must match the specificiations in STL_Allocator.
17 class CustomAllocator {
18 public:
19 // If no arena is provided, LowLevelAlloc still uses its default arena.
20 static void SetArena(LowLevelAlloc::Arena* arena);
21
22 static void* Allocate(size_t size);
23 static void Free(void* ptr, size_t size);
24
25 private:
26 static LowLevelAlloc::Arena* arena_;
27 };
28
29 #endif // BASE_CUSTOM_ALLOCATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698