| Index: third_party/tcmalloc/chromium/src/gperftools/custom_allocator.h
|
| diff --git a/third_party/tcmalloc/chromium/src/gperftools/custom_allocator.h b/third_party/tcmalloc/chromium/src/gperftools/custom_allocator.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..524176b7f3ba12d82f47b7e414ae693d1d7909e5
|
| --- /dev/null
|
| +++ b/third_party/tcmalloc/chromium/src/gperftools/custom_allocator.h
|
| @@ -0,0 +1,26 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CUSTOM_ALLOCATOR_H_
|
| +#define CUSTOM_ALLOCATOR_H_
|
| +
|
| +#include <stddef.h>
|
| +
|
| +// PERFTOOLS_DLL_DECL is unnecessary, as it is Windows specific.
|
| +
|
| +// A container class for using LowLevelAlloc with STL_Allocator. The functions
|
| +// Allocate() and Free() must match the specificiations in STL_Allocator.
|
| +class CustomAllocator {
|
| + public:
|
| + // This is a stateless class, but there is static data within the module that
|
| + // needs to be created and deleted.
|
| + static void Initialize();
|
| + static bool Shutdown();
|
| + static bool IsInitialized();
|
| +
|
| + static void* Allocate(size_t size);
|
| + static void Free(void* ptr, size_t size);
|
| +};
|
| +
|
| +#endif // CUSTOM_ALLOCATOR_H_
|
|
|