Permalink
Cannot retrieve contributors at this time
47 lines (39 sloc)
1.43 KB
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
WebKit/Source/WTF/wtf/RefCountedLeakCounter.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2008 Apple Inc. All rights reserved. | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Library General Public | |
* License as published by the Free Software Foundation; either | |
* version 2 of the License, or (at your option) any later version. | |
* | |
* This library is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
* Library General Public License for more details. | |
* | |
* You should have received a copy of the GNU Library General Public License | |
* along with this library; see the file COPYING.LIB. If not, write to | |
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
* Boston, MA 02110-1301, USA. | |
* | |
*/ | |
#pragma once | |
#include <atomic> | |
#include <wtf/Assertions.h> | |
namespace WTF { | |
struct RefCountedLeakCounter { | |
WTF_EXPORT_PRIVATE static void suppressMessages(const char*); | |
WTF_EXPORT_PRIVATE static void cancelMessageSuppression(const char*); | |
WTF_EXPORT_PRIVATE explicit RefCountedLeakCounter(const char* description); | |
WTF_EXPORT_PRIVATE ~RefCountedLeakCounter(); | |
WTF_EXPORT_PRIVATE void increment(); | |
WTF_EXPORT_PRIVATE void decrement(); | |
#ifndef NDEBUG | |
private: | |
std::atomic<int> m_count; | |
#if !LOG_DISABLED | |
const char* m_description; | |
#endif | |
#endif | |
}; | |
} // namespace WTF |