Loading ndb/src/kernel/error/ErrorReporter.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ ErrorReporter::setErrorHandlerShutdownType(NdbShutdownType nst) void childReportError(int error); void ErrorReporter::handleAssert(const char* message, const char* file, int line) ErrorReporter::handleAssert(const char* message, const char* file, int line, int ec) { char refMessage[100]; Loading @@ -179,10 +179,10 @@ ErrorReporter::handleAssert(const char* message, const char* file, int line) BaseString::snprintf(refMessage, 100, "%s line: %d (block: %s)", file, line, blockName); #endif WriteMessage(NDBD_EXIT_PRGERR, message, refMessage, WriteMessage(ec, message, refMessage, theEmulatedJamIndex, theEmulatedJam); childReportError(NDBD_EXIT_PRGERR); childReportError(ec); NdbShutdown(s_errorHandlerShutdownType); } Loading ndb/src/kernel/error/ErrorReporter.hpp +2 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #define ERRORREPORTER_H #include <ndb_global.h> #include <ndbd_exit_codes.h> #include "TimeModule.hpp" #include <Emulator.hpp> Loading @@ -28,7 +29,7 @@ public: static void setErrorHandlerShutdownType(NdbShutdownType nst = NST_ErrorHandler); static void handleAssert(const char* message, const char* file, int line); int line, int ec = NDBD_EXIT_PRGERR); static void handleError(int faultID, const char* problemData, Loading ndb/src/kernel/vm/ArrayPool.hpp +14 −4 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ public: * * Note, can currently only be called once */ bool setSize(Uint32 noOfElements); bool setSize(Uint32 noOfElements, bool exit_on_error = true); inline Uint32 getNoOfFree() const { return noOfFree; Loading Loading @@ -218,13 +218,19 @@ ArrayPool<T>::~ArrayPool(){ template <class T> inline bool ArrayPool<T>::setSize(Uint32 noOfElements){ ArrayPool<T>::setSize(Uint32 noOfElements, bool exit_on_error){ if(size == 0){ if(noOfElements == 0) return true; theArray = (T *)NdbMem_Allocate(noOfElements * sizeof(T)); if(theArray == 0) { if (!exit_on_error) return false; ErrorReporter::handleAssert("ArrayPool<T>::setSize malloc failed", __FILE__, __LINE__, NDBD_EXIT_MEMALLOC); return false; // not reached } size = noOfElements; noOfFree = noOfElements; Loading @@ -247,7 +253,11 @@ ArrayPool<T>::setSize(Uint32 noOfElements){ return true; } if (!exit_on_error) return false; ErrorReporter::handleAssert("ArrayPool<T>::setSize called twice", __FILE__, __LINE__); return false; // not reached } template <class T> Loading ndb/src/kernel/vm/CArray.hpp +9 −3 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ public: * * Note, can currently only be called once */ bool setSize(Uint32 noOfElements); bool setSize(Uint32 noOfElements, bool exit_on_error = true); /** * Get size Loading Loading @@ -82,13 +82,19 @@ CArray<T>::~CArray(){ template <class T> inline bool CArray<T>::setSize(Uint32 noOfElements){ CArray<T>::setSize(Uint32 noOfElements, bool exit_on_error){ if(size == noOfElements) return true; theArray = (T *)NdbMem_Allocate(noOfElements * sizeof(T)); if(theArray == 0) { if (!exit_on_error) return false; ErrorReporter::handleAssert("CArray<T>::setSize malloc failed", __FILE__, __LINE__, NDBD_EXIT_MEMALLOC); return false; // not reached } size = noOfElements; return true; } Loading ndb/src/kernel/vm/SafeCounter.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -25,8 +25,8 @@ SafeCounterManager::SafeCounterManager(class SimulatedBlock & block) {} bool SafeCounterManager::setSize(Uint32 maxNoOfActiveMutexes) { return m_counterPool.setSize(maxNoOfActiveMutexes); SafeCounterManager::setSize(Uint32 maxNoOfActiveMutexes, bool exit_on_error) { return m_counterPool.setSize(maxNoOfActiveMutexes, exit_on_error); } Uint32 Loading Loading
ndb/src/kernel/error/ErrorReporter.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ ErrorReporter::setErrorHandlerShutdownType(NdbShutdownType nst) void childReportError(int error); void ErrorReporter::handleAssert(const char* message, const char* file, int line) ErrorReporter::handleAssert(const char* message, const char* file, int line, int ec) { char refMessage[100]; Loading @@ -179,10 +179,10 @@ ErrorReporter::handleAssert(const char* message, const char* file, int line) BaseString::snprintf(refMessage, 100, "%s line: %d (block: %s)", file, line, blockName); #endif WriteMessage(NDBD_EXIT_PRGERR, message, refMessage, WriteMessage(ec, message, refMessage, theEmulatedJamIndex, theEmulatedJam); childReportError(NDBD_EXIT_PRGERR); childReportError(ec); NdbShutdown(s_errorHandlerShutdownType); } Loading
ndb/src/kernel/error/ErrorReporter.hpp +2 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #define ERRORREPORTER_H #include <ndb_global.h> #include <ndbd_exit_codes.h> #include "TimeModule.hpp" #include <Emulator.hpp> Loading @@ -28,7 +29,7 @@ public: static void setErrorHandlerShutdownType(NdbShutdownType nst = NST_ErrorHandler); static void handleAssert(const char* message, const char* file, int line); int line, int ec = NDBD_EXIT_PRGERR); static void handleError(int faultID, const char* problemData, Loading
ndb/src/kernel/vm/ArrayPool.hpp +14 −4 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ public: * * Note, can currently only be called once */ bool setSize(Uint32 noOfElements); bool setSize(Uint32 noOfElements, bool exit_on_error = true); inline Uint32 getNoOfFree() const { return noOfFree; Loading Loading @@ -218,13 +218,19 @@ ArrayPool<T>::~ArrayPool(){ template <class T> inline bool ArrayPool<T>::setSize(Uint32 noOfElements){ ArrayPool<T>::setSize(Uint32 noOfElements, bool exit_on_error){ if(size == 0){ if(noOfElements == 0) return true; theArray = (T *)NdbMem_Allocate(noOfElements * sizeof(T)); if(theArray == 0) { if (!exit_on_error) return false; ErrorReporter::handleAssert("ArrayPool<T>::setSize malloc failed", __FILE__, __LINE__, NDBD_EXIT_MEMALLOC); return false; // not reached } size = noOfElements; noOfFree = noOfElements; Loading @@ -247,7 +253,11 @@ ArrayPool<T>::setSize(Uint32 noOfElements){ return true; } if (!exit_on_error) return false; ErrorReporter::handleAssert("ArrayPool<T>::setSize called twice", __FILE__, __LINE__); return false; // not reached } template <class T> Loading
ndb/src/kernel/vm/CArray.hpp +9 −3 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ public: * * Note, can currently only be called once */ bool setSize(Uint32 noOfElements); bool setSize(Uint32 noOfElements, bool exit_on_error = true); /** * Get size Loading Loading @@ -82,13 +82,19 @@ CArray<T>::~CArray(){ template <class T> inline bool CArray<T>::setSize(Uint32 noOfElements){ CArray<T>::setSize(Uint32 noOfElements, bool exit_on_error){ if(size == noOfElements) return true; theArray = (T *)NdbMem_Allocate(noOfElements * sizeof(T)); if(theArray == 0) { if (!exit_on_error) return false; ErrorReporter::handleAssert("CArray<T>::setSize malloc failed", __FILE__, __LINE__, NDBD_EXIT_MEMALLOC); return false; // not reached } size = noOfElements; return true; } Loading
ndb/src/kernel/vm/SafeCounter.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -25,8 +25,8 @@ SafeCounterManager::SafeCounterManager(class SimulatedBlock & block) {} bool SafeCounterManager::setSize(Uint32 maxNoOfActiveMutexes) { return m_counterPool.setSize(maxNoOfActiveMutexes); SafeCounterManager::setSize(Uint32 maxNoOfActiveMutexes, bool exit_on_error) { return m_counterPool.setSize(maxNoOfActiveMutexes, exit_on_error); } Uint32 Loading