Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. What container to use instead of qbytearray to allow for more ram usage?
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 762 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Q139
    wrote on last edited by
    #1

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

    ? kshegunovK 2 Replies Last reply
    0
    • Q Q139

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

      ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      @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.

      1 Reply Last reply
      1
      • Q Q139

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

        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by
        #3

        @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).

        Read and abide by the Qt Code of Conduct

        ? 1 Reply Last reply
        0
        • kshegunovK kshegunov

          @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).

          ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          @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 ;-)

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved