diff options
author | 2022-06-03 22:29:14 +0000 | |
---|---|---|
committer | 2022-06-06 19:54:44 +0000 | |
commit | 695368ffae65d72655f70e25d04f23ed3e16e541 (patch) | |
tree | 4e26eb9343522afbb3e2c49a1b2c131a448d0c3d /libs/binder/RpcSession.cpp | |
parent | 2a49be691156b70a281602aaf84885269b142b8a (diff) |
Use android::base::function_ref isntead of std::function
This removes an allocation from the binder RPC calls.
Test: atest binderAllocationLimits
Bug: 230625474
Change-Id: I70ebb4e320323149c3c66809f1077cbf332c07ef
Diffstat (limited to 'libs/binder/RpcSession.cpp')
-rw-r--r-- | libs/binder/RpcSession.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/binder/RpcSession.cpp b/libs/binder/RpcSession.cpp index 6ae5357be2..5c35dd0ac1 100644 --- a/libs/binder/RpcSession.cpp +++ b/libs/binder/RpcSession.cpp @@ -615,7 +615,7 @@ status_t RpcSession::initAndAddConnection(unique_fd fd, const std::vector<uint8_ iovec headerIov{&header, sizeof(header)}; auto sendHeaderStatus = - server->interruptableWriteFully(mShutdownTrigger.get(), &headerIov, 1, {}); + server->interruptableWriteFully(mShutdownTrigger.get(), &headerIov, 1, std::nullopt); if (sendHeaderStatus != OK) { ALOGE("Could not write connection header to socket: %s", statusToString(sendHeaderStatus).c_str()); @@ -625,8 +625,8 @@ status_t RpcSession::initAndAddConnection(unique_fd fd, const std::vector<uint8_ if (sessionId.size() > 0) { iovec sessionIov{const_cast<void*>(static_cast<const void*>(sessionId.data())), sessionId.size()}; - auto sendSessionIdStatus = - server->interruptableWriteFully(mShutdownTrigger.get(), &sessionIov, 1, {}); + auto sendSessionIdStatus = server->interruptableWriteFully(mShutdownTrigger.get(), + &sessionIov, 1, std::nullopt); if (sendSessionIdStatus != OK) { ALOGE("Could not write session ID ('%s') to socket: %s", base::HexString(sessionId.data(), sessionId.size()).c_str(), |