summaryrefslogtreecommitdiff
path: root/ndb/src/kernel/vm/CArray.hpp
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2005-10-04 11:27:14 +0200
committerunknown <tomas@poseidon.ndb.mysql.com>2005-10-04 11:27:14 +0200
commitd9e5eaa572267827a52b651b4a3e9f86d38fd3ee (patch)
tree1805365d41d3971ed1f5b782d089907c89d25136 /ndb/src/kernel/vm/CArray.hpp
parenta1f9ec01924c53c8933350e0a1ed37a22077b09e (diff)
downloadmariadb-git-d9e5eaa572267827a52b651b4a3e9f86d38fd3ee.tar.gz
Bug#11739 SendBufferMemory set to 294967039 causes core where max = 4294967039
- added proper error message on all failed array pool mallocs
Diffstat (limited to 'ndb/src/kernel/vm/CArray.hpp')
-rw-r--r--ndb/src/kernel/vm/CArray.hpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/ndb/src/kernel/vm/CArray.hpp b/ndb/src/kernel/vm/CArray.hpp
index a6e84e2c041..e8159da9a58 100644
--- a/ndb/src/kernel/vm/CArray.hpp
+++ b/ndb/src/kernel/vm/CArray.hpp
@@ -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
@@ -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)
- return false;
+ {
+ 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;
}