switch remaining to use REFCOUNT macros

This commit is contained in:
Michael Davidsaver
2011-01-30 18:09:39 -05:00
parent 099215986f
commit 4a65bf9342
11 changed files with 52 additions and 445 deletions

View File

@@ -15,56 +15,24 @@ namespace epics { namespace pvData {
//static DebugLevel debugLevel = lowDebug;
static Mutex globalMutex;
static volatile int64 totalConstruct = 0;
static volatile int64 totalDestruct = 0;
static bool notInited = true;
static int64 getTotalConstruct()
{
Lock xx(&globalMutex);
return totalConstruct;
}
static int64 getTotalDestruct()
{
Lock xx(&globalMutex);
return totalDestruct;
}
static void init()
{
Lock xx(&globalMutex);
if(notInited) {
notInited = false;
ShowConstructDestruct::registerCallback(
String("bitSet"),
getTotalConstruct,getTotalDestruct,0,0);
}
}
PVDATA_REFCOUNT_MONITOR_DEFINE(bitSet);
BitSet::BitSet() : words(0), wordsLength(0), wordsInUse(0) {
initWords(BITS_PER_WORD);
init();
Lock xx(&globalMutex);
totalConstruct++;
PVDATA_REFCOUNT_MONITOR_CONSTRUCT(bitSet);
}
BitSet::BitSet(uint32 nbits) : words(0), wordsLength(0), wordsInUse(0) {
initWords(nbits);
init();
Lock xx(&globalMutex);
totalConstruct++;
PVDATA_REFCOUNT_MONITOR_CONSTRUCT(bitSet);
}
BitSet::~BitSet() {
delete[] words;
Lock xx(&globalMutex);
totalDestruct++;
PVDATA_REFCOUNT_MONITOR_DESTRUCT(bitSet);
}
void BitSet::initWords(uint32 nbits) {