summaryrefslogtreecommitdiff
path: root/ndb/include
diff options
context:
space:
mode:
authorunknown <jonas@eel.(none)>2005-09-16 11:26:34 +0200
committerunknown <jonas@eel.(none)>2005-09-16 11:26:34 +0200
commit979563399be65bffbf91db244717e777abeaca63 (patch)
treeb01a3839eb7d26be47a769b3a92d2a7106e2328e /ndb/include
parent01587e479af4ea3f369b534009c3160efb844bff (diff)
downloadmariadb-git-979563399be65bffbf91db244717e777abeaca63.tar.gz
ndb
impl support for querying resource usage in ndb api to help track down mem leaks ndb/include/ndbapi/Ndb.hpp: Impl. reporting of free list usage Put free list into handler class ndb/include/ndbapi/NdbBlob.hpp: Impl. reporting of free list usage Put free list into handler class ndb/include/ndbapi/NdbConnection.hpp: Impl. reporting of free list usage Put free list into handler class ndb/include/ndbapi/NdbIndexOperation.hpp: Impl. reporting of free list usage Put free list into handler class ndb/include/ndbapi/NdbIndexScanOperation.hpp: Impl. reporting of free list usage Put free list into handler class ndb/include/ndbapi/NdbOperation.hpp: Impl. reporting of free list usage Put free list into handler class ndb/include/ndbapi/NdbRecAttr.hpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/NdbApiSignal.cpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/NdbApiSignal.hpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/NdbBlob.cpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/NdbImpl.hpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/NdbRecAttr.cpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/NdbUtil.cpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/NdbUtil.hpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/Ndbif.cpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/Ndbinit.cpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/Ndblist.cpp: Impl. reporting of free list usage Put free list into handler class ndb/tools/restore/Restore.cpp: Impl. reporting of free list usage Put free list into handler class
Diffstat (limited to 'ndb/include')
-rw-r--r--ndb/include/ndbapi/Ndb.hpp28
-rw-r--r--ndb/include/ndbapi/NdbBlob.hpp6
-rw-r--r--ndb/include/ndbapi/NdbConnection.hpp12
-rw-r--r--ndb/include/ndbapi/NdbIndexOperation.hpp1
-rw-r--r--ndb/include/ndbapi/NdbIndexScanOperation.hpp2
-rw-r--r--ndb/include/ndbapi/NdbOperation.hpp8
-rw-r--r--ndb/include/ndbapi/NdbRecAttr.hpp7
7 files changed, 37 insertions, 27 deletions
diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp
index 766409d64e2..e905a304c97 100644
--- a/ndb/include/ndbapi/Ndb.hpp
+++ b/ndb/include/ndbapi/Ndb.hpp
@@ -882,10 +882,10 @@ class BaseString;
class NdbEventOperation;
class NdbBlob;
class NdbReceiver;
+template <class T> struct Ndb_free_list_t;
typedef void (* NdbEventCallback)(NdbEventOperation*, Ndb*, void*);
-
#if defined NDB_OSE
/**
* Default time to wait for response after request has been sent to
@@ -1386,8 +1386,20 @@ public:
*/
NdbConnection* hupp( NdbConnection* );
Uint32 getReference() const { return theMyRef;}
+
+ struct Free_list_usage
+ {
+ const char * m_name;
+ Uint32 m_created;
+ Uint32 m_free;
+ Uint32 m_sizeof;
+ };
+
+ Free_list_usage * get_free_list_usage(Free_list_usage*);
#endif
+
+
/*****************************************************************************
* These are service routines used by the other classes in the NDBAPI.
****************************************************************************/
@@ -1562,22 +1574,8 @@ private:
class NdbDictionaryImpl* theDictionary;
class NdbGlobalEventBufferHandle* theGlobalEventBufferHandle;
- NdbConnection* theConIdleList; // First connection in idle list.
-
- NdbOperation* theOpIdleList; // First operation in the idle list.
-
- NdbIndexScanOperation* theScanOpIdleList; // First scan operation in the idle list.
- NdbIndexOperation* theIndexOpIdleList; // First index operation in the idle list.
NdbConnection* theTransactionList;
NdbConnection** theConnectionArray;
- NdbRecAttr* theRecAttrIdleList;
- NdbApiSignal* theSignalIdleList; // First signal in idlelist.
- NdbLabel* theLabelList; // First label descriptor in list
- NdbBranch* theBranchList; // First branch descriptor in list
- NdbSubroutine* theSubroutineList; // First subroutine descriptor in
- NdbCall* theCallList; // First call descriptor in list
- NdbReceiver* theScanList;
- NdbBlob* theNdbBlobIdleList;
Uint32 theMyRef; // My block reference
Uint32 theNode; // The node number of our node
diff --git a/ndb/include/ndbapi/NdbBlob.hpp b/ndb/include/ndbapi/NdbBlob.hpp
index b145c69b04b..a04f4f72bc9 100644
--- a/ndb/include/ndbapi/NdbBlob.hpp
+++ b/ndb/include/ndbapi/NdbBlob.hpp
@@ -262,7 +262,7 @@ private:
// for keeping in lists
NdbBlob* theNext;
// initialization
- NdbBlob();
+ NdbBlob(Ndb*);
void init();
void release();
// classify operations
@@ -314,6 +314,10 @@ private:
int getOperationType() const;
friend class NdbOut& operator<<(NdbOut&, const NdbBlob&);
#endif
+
+ void next(NdbBlob* obj) { theNext= obj;}
+ NdbBlob* next() { return theNext;}
+ friend struct Ndb_free_list_t<NdbBlob>;
};
#endif
diff --git a/ndb/include/ndbapi/NdbConnection.hpp b/ndb/include/ndbapi/NdbConnection.hpp
index 2ab6f7d6f64..75c3f80121d 100644
--- a/ndb/include/ndbapi/NdbConnection.hpp
+++ b/ndb/include/ndbapi/NdbConnection.hpp
@@ -18,8 +18,9 @@
#define NdbConnection_H
#include <ndb_types.h>
-#include <NdbError.hpp>
-#include <NdbDictionary.hpp>
+#include "NdbError.hpp"
+#include "NdbDictionary.hpp"
+#include "Ndb.hpp"
class NdbConnection;
class NdbOperation;
@@ -465,10 +466,10 @@ private:
/**************************************************************************
* These are the create and delete methods of this class. *
**************************************************************************/
-
NdbConnection(Ndb* aNdb);
-
~NdbConnection();
+ NdbConnection* next(); // Returns the next pointer
+ void next(NdbConnection*); // Sets the next pointer
void init(); // Initialize connection object for new transaction
@@ -487,8 +488,6 @@ private:
int getTC_ConnectPtr(); // Gets TC Connect pointer
void setBuddyConPtr(Uint32); // Sets Buddy Con Ptr
Uint32 getBuddyConPtr(); // Gets Buddy Con Ptr
- NdbConnection* next(); // Returns the next pointer
- void next(NdbConnection*); // Sets the next pointer
enum ConStatusType {
NotConnected,
@@ -691,6 +690,7 @@ private:
void define_scan_op(NdbIndexScanOperation*);
friend class HugoOperations;
+ friend struct Ndb_free_list_t<NdbConnection>;
};
inline
diff --git a/ndb/include/ndbapi/NdbIndexOperation.hpp b/ndb/include/ndbapi/NdbIndexOperation.hpp
index 1472f1b249e..2ab63cfc4f9 100644
--- a/ndb/include/ndbapi/NdbIndexOperation.hpp
+++ b/ndb/include/ndbapi/NdbIndexOperation.hpp
@@ -200,6 +200,7 @@ private:
Uint32 m_theIndexDefined[NDB_MAX_ATTRIBUTES_IN_INDEX][3];
Uint32 m_theIndexLen; // Length of the index in words
Uint32 m_theNoOfIndexDefined; // The number of index attributes
+ friend struct Ndb_free_list_t<NdbIndexOperation>;
};
#endif
diff --git a/ndb/include/ndbapi/NdbIndexScanOperation.hpp b/ndb/include/ndbapi/NdbIndexScanOperation.hpp
index a3388f62f58..7cd2daea6a6 100644
--- a/ndb/include/ndbapi/NdbIndexScanOperation.hpp
+++ b/ndb/include/ndbapi/NdbIndexScanOperation.hpp
@@ -132,6 +132,8 @@ private:
int compare(Uint32 key, Uint32 cols, const NdbReceiver*, const NdbReceiver*);
Uint32 m_sort_columns;
+
+ friend struct Ndb_free_list_t<NdbIndexScanOperation>;
};
#endif
diff --git a/ndb/include/ndbapi/NdbOperation.hpp b/ndb/include/ndbapi/NdbOperation.hpp
index 46d4ddab0f5..46e44226e18 100644
--- a/ndb/include/ndbapi/NdbOperation.hpp
+++ b/ndb/include/ndbapi/NdbOperation.hpp
@@ -22,6 +22,7 @@
#include "NdbError.hpp"
#include "NdbReceiver.hpp"
#include "NdbDictionary.hpp"
+#include "Ndb.hpp"
class Ndb;
class NdbApiSignal;
@@ -723,8 +724,6 @@ protected:
/******************************************************************************
* These are the methods used to create and delete the NdbOperation objects.
*****************************************************************************/
- NdbOperation(Ndb* aNdb);
- virtual ~NdbOperation();
bool needReply();
/******************************************************************************
@@ -736,8 +735,9 @@ protected:
int init(const class NdbTableImpl*, NdbConnection* aCon);
void initInterpreter();
+ NdbOperation(Ndb* aNdb);
+ virtual ~NdbOperation();
void next(NdbOperation*); // Set next pointer
-
NdbOperation* next(); // Get next pointer
enum OperationStatus{
@@ -925,6 +925,8 @@ protected:
* IgnoreError on connection level.
*/
Int8 m_abortOption;
+
+ friend struct Ndb_free_list_t<NdbOperation>;
};
#ifdef NDB_NO_DROPPED_SIGNAL
diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp
index 05635a99385..741ea3d52e2 100644
--- a/ndb/include/ndbapi/NdbRecAttr.hpp
+++ b/ndb/include/ndbapi/NdbRecAttr.hpp
@@ -17,7 +17,8 @@
#ifndef NdbRecAttr_H
#define NdbRecAttr_H
-#include <NdbDictionary.hpp>
+#include "NdbDictionary.hpp"
+#include "Ndb.hpp"
class NdbOperation;
@@ -242,7 +243,6 @@ public:
*/
~NdbRecAttr();
private:
- NdbRecAttr();
Uint32 attrId() const; /* Get attribute id */
bool setNULL(); /* Set NULL indicator */
@@ -251,6 +251,7 @@ private:
void release(); /* Release memory if allocated */
void init(); /* Initialise object when allocated */
+ NdbRecAttr(Ndb*);
void next(NdbRecAttr* aRecAttr);
NdbRecAttr* next() const;
@@ -273,6 +274,8 @@ private:
Uint32 theAttrSize;
Uint32 theArraySize;
const NdbDictionary::Column* m_column;
+
+ friend struct Ndb_free_list_t<NdbRecAttr>;
};
inline