//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project / pf
//
//File: memory.cpp
//
//Version: $Revision: 1.2 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/10/05 06:50:01 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//      Vesa-Matti Puro
//
//Description:
//
//
//Copyright:
//      Copyright 1999 Helsinki University of Technology
//      ALL RIGHTS RESERVED BETWEEN JANUARY 1996 AND JUNE 1999.
//
//Licence:
//
//
//History:
//
//

#include "memory.h"
#include <malloc.h>
#include "debug.h"

int pfMemory::_newCount = 0;
int pfMemory::_deleteCount = 0;
int pfMemory::_lazyFrameCopyCount = 0;

void pfMemory :: reset (void)
{
    _newCount = 0;
    _deleteCount = 0;
    _lazyFrameCopyCount = 0;
    return;
}

void pfMemory :: report (void)
{
    debugPfUlong("cout of calls to operator new", _newCount);
    debugPfUlong("operator delete called", _deleteCount);
    debugPfUlong("lazy frame copies", _lazyFrameCopyCount);
    return;
}

#if 0
void *operator new(size_t size)
{
    ++pfMemory::_newCount;
    return malloc (size); 
}

void operator delete(void *p)
{
    ++pfMemory::_deleteCount;
    free (p);
    return;
}
#endif

