summaryrefslogtreecommitdiff
path: root/libs/binder/RpcState.cpp
diff options
context:
space:
mode:
author Frederick Mayle <fmayle@google.com> 2022-05-09 23:02:54 +0000
committer Frederick Mayle <fmayle@google.com> 2022-06-03 20:44:58 +0000
commitd3c595abee0ae0c3055bd877b02111171054ec33 (patch)
tree184f4bbefd4451bfd97be5a1a94c27e9f30a1252 /libs/binder/RpcState.cpp
parent5caafddc6ba268b60a3c3be97b39e073c342c295 (diff)
binder: Use variant for backend specific Parcel fields
This frees up some space to add RPC binder specific bookkeeping to Parcel. `variant` has a size overhead of one pointer, but since there is at least one pointer worth of fields in each case, it works out as an overall win. We could probably do it cheaper by using a union and hiding a bit field somewhere to indicate the active case, but that isn't necessary yet. Bug: 185909244 Test: TH Change-Id: Id53ea0cbfe51b3246e6f9f1f3d9df7c8c193808e
Diffstat (limited to 'libs/binder/RpcState.cpp')
-rw-r--r--libs/binder/RpcState.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/libs/binder/RpcState.cpp b/libs/binder/RpcState.cpp
index 2a8e9c1d8b..c6460b8330 100644
--- a/libs/binder/RpcState.cpp
+++ b/libs/binder/RpcState.cpp
@@ -601,10 +601,8 @@ status_t RpcState::waitForReply(const sp<RpcSession::RpcConnection>& connection,
if (rpcReply->status != OK) return rpcReply->status;
data.release();
- reply->ipcSetDataReference(rpcReply->data, command.bodySize - offsetof(RpcWireReply, data),
- nullptr, 0, cleanup_reply_data);
-
- reply->markForRpc(session);
+ reply->rpcSetDataReference(session, rpcReply->data,
+ command.bodySize - offsetof(RpcWireReply, data), cleanup_reply_data);
return OK;
}
@@ -824,11 +822,9 @@ processTransactInternalTailCall:
// transaction->data is owned by this function. Parcel borrows this data and
// only holds onto it for the duration of this function call. Parcel will be
// deleted before the 'transactionData' object.
- data.ipcSetDataReference(transaction->data,
+ data.rpcSetDataReference(session, transaction->data,
transactionData.size() - offsetof(RpcWireTransaction, data),
- nullptr /*object*/, 0 /*objectCount*/,
do_nothing_to_transact_data);
- data.markForRpc(session);
if (target) {
bool origAllowNested = connection->allowNested;