SharingPtr.cpp revision 987c7ebe1daa425ba7abfa9643800e3237146fc0
1//===---------------------SharingPtr.cpp ------------------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "lldb/Utility/SharingPtr.h"
11
12namespace lldb_private {
13
14namespace imp
15{
16
17
18    shared_count::~shared_count()
19    {
20    }
21
22    void
23    shared_count::add_shared()
24    {
25        increment(shared_owners_);
26    }
27
28    void
29    shared_count::release_shared()
30    {
31        if (decrement(shared_owners_) == -1)
32        {
33            on_zero_shared();
34            delete this;
35        }
36    }
37
38} // imp
39
40
41} // namespace lldb
42
43