Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.12.3
-
None
-
-
b321559a22a3ee6490695ecb9d95d3c9fbf7ee1c
Description
The following code
#include <QByteArray>
#include <QDebug>
int main(int argc, char *argv[])
{ QByteArray ba; ba.resize(std::numeric_limits<int>::max()); qDebug() << ba.size(); }
crashes with
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
I've been told "it is known" that the max size QByteArray can hold is 2^31 but i can't find anything in the documentation.
It would be nice if one could have a QByteArray::maxsize or something that could be used for that.