pstream: Optimise write of smaller packages
authorDavid Henningsson <david.henningsson@canonical.com>
Fri, 5 Apr 2013 19:13:04 +0000 (21:13 +0200)
committerDavid Henningsson <david.henningsson@canonical.com>
Tue, 9 Apr 2013 12:25:51 +0000 (14:25 +0200)
commitb4342845db2bec59f9e486202bf02a9fb1dd10e8
treea1934c8ce98602e2f73b28db9c2ac313ef798d13
parent179cacfc6620839cc9c4399e3f0a995bc499145f
pstream: Optimise write of smaller packages

During a stream, most packets sent are either memblocks (with SHM info),
or requests for more data. These are only slightly bigger than the
header.

This patch makes it possible to write these packages in one write
instead of two: a memcpy of just a few bytes is worth saving extra
syscalls for write and poll.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
src/pulsecore/pstream.c