Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Issue 759023004: MachMessageServer: handle allocations more reasonably (Closed)

Created:
6 years ago by Mark Mentovai
Modified:
6 years ago
Reviewers:
Robert Sesek
CC:
crashpad-dev_chromium.org
Base URL:
https://chromium.googlesource.com/crashpad/crashpad@master
Project:
crashpad
Visibility:
Public.

Description

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 Committed: https://chromium.googlesource.com/crashpad/crashpad/+/49f170e6334865054e617f6e17d72c90f463ed14

Patch Set 1 #

Total comments: 2

Patch Set 2 : Address review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+57 lines, -43 lines) Patch
M util/mach/mach_message_server.cc View 1 6 chunks +57 lines, -43 lines 0 comments Download

Messages

Total messages: 7 (1 generated)
Mark Mentovai
6 years ago (2014-11-25 23:02:49 UTC) #2
Mark Mentovai
I think you can skip reviewing this as-is, I have a couple of ideas for ...
6 years ago (2014-11-30 21:45:18 UTC) #3
Robert Sesek
https://codereview.chromium.org/759023004/diff/1/util/mach/mach_message_server.cc File util/mach/mach_message_server.cc (right): https://codereview.chromium.org/759023004/diff/1/util/mach/mach_message_server.cc#newcode149 util/mach/mach_message_server.cc:149: if (request_scoper.size() != this_request_alloc) { Rather than equality, why ...
6 years ago (2014-12-01 20:59:17 UTC) #4
Mark Mentovai
https://codereview.chromium.org/759023004/diff/1/util/mach/mach_message_server.cc File util/mach/mach_message_server.cc (right): https://codereview.chromium.org/759023004/diff/1/util/mach/mach_message_server.cc#newcode149 util/mach/mach_message_server.cc:149: if (request_scoper.size() != this_request_alloc) { Robert Sesek wrote: > ...
6 years ago (2014-12-01 21:04:09 UTC) #5
Robert Sesek
LGTM
6 years ago (2014-12-01 21:09:02 UTC) #6
Mark Mentovai
6 years ago (2014-12-01 21:13:44 UTC) #7
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
49f170e6334865054e617f6e17d72c90f463ed14 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698