Mark Mentovai 49f170e633 MachMessageServer: handle allocations more reasonably.
MachMessageServer was wasteful with allocations for request and reply
messages. It allocated new memory for each request receive and for each
reply send, and if it needed to resize an allocation for a request, it
would maintain two request allocations simultaneously. The new behavior
allocates memory for a new request only if it needs a different size
than for the previous request, and it never maintains two request
allocations simultaneously. Memory for a reply is allocated once per
method invocation and maintained, since this never needs to be resized.

One pass of the loop is now guaranteed, even if a caller specifies a
very small timeout that expires before attempting to receive a message.

An infinite looping bug that could occur when ignoring large messages
has also been fixed.

TEST=util_test MachMessageServer.*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/759023004
2014-12-01 16:13:40 -05:00
2014-07-30 23:24:58 -04:00
2014-09-12 12:13:27 -04:00
2014-07-30 23:24:58 -04:00
2014-07-30 23:24:58 -04:00
2014-07-30 23:24:58 -04:00
2014-07-30 23:24:58 -04:00
2014-10-02 17:09:37 -04:00
2014-11-25 14:56:05 -05:00
2014-07-30 23:24:58 -04:00
2014-07-30 23:24:58 -04:00
Description
A crash-reporting system
Apache-2.0
Languages
C++ 92.6%
Objective-C++ 2.5%
C 2%
Python 1.7%
Assembly 0.9%
Other 0.3%