What container to use instead of qbytearray to allow for more ram usage?



  • Qbytearray limit is about 4gb , what container to use instead or how to work around for buffer to allow for more space?


  • Moderators

    @Q139 Hi! Actually QByteArray is limited to about 2GB. But back to your question:

    qDebug() << std::numeric_limits< std::vector<char>::size_type >::max();
    

    This gives 18446744073709551615 on amd64. Should be enough for the next decade.


  • Qt Champions 2016

    @Q139
    If you need to open a single block over 2GB of size, you're probably doing something wrong. In any case, you can't have an address that's over the address a pointer can reference, so even with raw pointers there's a limit (a huge one for x64, granted, but it exists), and it's basically what Wieland posted. For a 64 bit pointer you can address about 16 exabytes (exa- means 10^18).


  • Moderators

    @kshegunov said:

    If you need to open a single block over 2GB of size, you're probably doing something wrong.

    Didn't want to say that but: yeah, that was pretty much my first thought, too ;-)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.