Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

allocObjectTrace.cpp

00001 /*
00002  *                         Sun Public License Notice
00003  *
00004  * The contents of this file are subject to the Sun Public License
00005  * Version 1.0 (the "License"); you may not use this file except
00006  * in compliance with the License. A copy of the License is available
00007  * at http://www.sun.com/
00008  *
00009  * The Original Code is the Java Profiler module.  The Initial Developers
00010  * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner,
00011  * Lukas Petru and Marek Przeczek.
00012  *
00013  * Portions created by Jan Stola are Copyright (C) 2000-2001.
00014  * All Rights Reserved.
00015  *
00016  * Portions created by Pavel Vacha are Copyright (C) 2000-2001.
00017  * All Rights Reserved.
00018  *
00019  * Portions created by Michal Pise are Copyright (C) 2000-2001.
00020  * All Rights Reserved.
00021  *
00022  * Portions created by Petr Luner are Copyright (C) 2000-2001.
00023  * All Rights Reserved.
00024  *
00025  * Portions created by Lukas Petru are Copyright (C) 2000-2001.
00026  * All Rights Reserved.
00027  *
00028  * Portions created by Marek Przeczek are Copyright (C) 2000-2001.
00029  * All Rights Reserved.
00030  *
00031  * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner,
00032  *               Lukas Petru and Marek Przeczek.
00033  */
00034 
00035 #include "../alloc/allocObjectTrace.h"
00036 #include "../prof/prof.h"
00037 #include "../alloc/allocTrace.h"
00038 #include "../alloc/allocObjectMethod.h"
00039 #include "../alloc/allocObject.h"
00040 
00041 #ifdef USE_ALLOCATOR
00042 Allocator AllocObjectTrace::_allocator;
00043 #endif
00044 
00045 void AllocObjectTrace::addMemoryStat( jint size) {
00046 
00047         if( !modified()) {
00048 
00049                 AllocAbstractStatThreadObject::addMemoryStat( size);
00050 
00051                 trace->addMemoryStat( size);
00052                 objectMethod->addMemoryStat( size);
00053         }
00054 }
00055 
00056 void AllocObjectTrace::subMemoryStat( jint size) {
00057         
00058         if( !modified()) {
00059         
00060                 AllocAbstractStatThreadObject::subMemoryStat( size);
00061 
00062                 trace->subMemoryStat( size);
00063                 objectMethod->subMemoryStat( size);
00064         }
00065 }
00066 
00067 void AllocObjectTrace::clearFlag() {
00068         
00069         AllocAbstractStatThreadObject::clearFlag();
00070 
00071         objectMethod->clearFlag();
00072 }
00073 
00074 void AllocObjectTrace::deactivate() {
00075 
00076         Prof::prof().activeAllocObjectTraces.removeNoRehash(this); 
00077 }
00078 
00079 const AllocObjectTraceKey& AllocObjectTrace::getKey(AllocObjectTraceKey& key) {
00080 
00081         objectMethod->object->getKey(key.objectKey);
00082         trace->getKey(key.traceKey);
00083         return key;
00084 }
00085 
00086 int AllocObjectTrace::operator==(const AllocObjectTraceKey& key) {
00087 
00088         return (*objectMethod->object == key.objectKey) && (*trace == key.traceKey);
00089 }
00090 
00091 int AllocObjectTrace::hashKey(const AllocObjectTraceKey& key) {
00092 
00093         return AllocObject::hashKey(key.objectKey) ^ Trace::hashKey(key.traceKey);
00094 }
00095 
00096 int AllocObjectTrace::isActive() {
00097 
00098         return (trace->isActive() && objectMethod->isActive());
00099 }
00100 
00101 void AllocObjectTrace::setUnchanged() {
00102                 
00103         IdObject::setUnchanged();
00104         clearDataChanged();
00105 }

Generated on Mon Jan 28 14:53:25 2002 for Java Profiler Dynamic Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001