25 linhas
494 B
C++
25 linhas
494 B
C++
// Copyright 2016 The Fuchsia Authors
|
|
//
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file or at
|
|
// https://opensource.org/licenses/MIT
|
|
|
|
#pragma once
|
|
|
|
class RefCallCounter {
|
|
public:
|
|
RefCallCounter();
|
|
|
|
void AddRef();
|
|
bool Release();
|
|
|
|
void Adopt() {}
|
|
|
|
int add_ref_calls() const { return add_ref_calls_; }
|
|
int release_calls() const { return release_calls_; }
|
|
|
|
private:
|
|
int add_ref_calls_;
|
|
int release_calls_;
|
|
};
|