diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-08-23 13:11:34 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-09-13 16:19:54 +0000 |
commit | a9ff368ac7244009b7a961388fe95372fbd7179c (patch) | |
tree | ecffd0cb4921ae95133bd8a8468ee985804a0d9c /qmake/main.cpp | |
parent | 3b61cd6ad738b8479bf216dcf736bb935e8812df (diff) |
QNativeSocketEngine: reduce memory usage in nativePendingDatagramSize()
The Windows implementation had the right idea: by using a chunked read,
we can tell the OS to reuse the same buffer over and over, so we don't
need to grow a buffer to the size of the datagram when peeking. This
commit implements that strategy on Unix and changes both implementations
to start at 1500 bytes instead of 8192 (1500 is more than enough for
almost all datagrams we're going to receive).
Let's also not use a static buffer, but a stack-based one. No need to
dedicate 1500 (or, worse, 8192) bytes for something that is only seldom
called.
Change-Id: I320d9d2f42284a69a4cbfffd14dd92a6775bf28b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'qmake/main.cpp')
0 files changed, 0 insertions, 0 deletions