Loading libs/binder/ndk/ibinder.cpp +10 −15 Original line number Diff line number Diff line Loading @@ -198,13 +198,8 @@ AIBinder_Weak* AIBinder_Weak_new(AIBinder* binder) { return new AIBinder_Weak{wp<AIBinder>(binder)}; } void AIBinder_Weak_delete(AIBinder_Weak** weakBinder) { if (weakBinder == nullptr) { return; } delete *weakBinder; *weakBinder = nullptr; void AIBinder_Weak_delete(AIBinder_Weak* weakBinder) { delete weakBinder; } AIBinder* AIBinder_Weak_promote(AIBinder_Weak* weakBinder) { if (weakBinder == nullptr) { Loading Loading @@ -437,6 +432,11 @@ binder_status_t AIBinder_prepareTransaction(AIBinder* binder, AParcel** in) { return ret; } static void DestroyParcel(AParcel** parcel) { delete *parcel; *parcel = nullptr; } binder_status_t AIBinder_transact(AIBinder* binder, transaction_code_t code, AParcel** in, AParcel** out, binder_flags_t flags) { if (in == nullptr) { Loading @@ -447,7 +447,7 @@ binder_status_t AIBinder_transact(AIBinder* binder, transaction_code_t code, APa using AutoParcelDestroyer = std::unique_ptr<AParcel*, void (*)(AParcel**)>; // This object is the input to the transaction. This function takes ownership of it and deletes // it. AutoParcelDestroyer forIn(in, AParcel_delete); AutoParcelDestroyer forIn(in, DestroyParcel); if (!isUserCommand(code)) { LOG(ERROR) << __func__ << ": Only user-defined transactions can be made from the NDK."; Loading Loading @@ -492,11 +492,6 @@ AIBinder_DeathRecipient* AIBinder_DeathRecipient_new( return new AIBinder_DeathRecipient(onBinderDied); } void AIBinder_DeathRecipient_delete(AIBinder_DeathRecipient** recipient) { if (recipient == nullptr) { return; } delete *recipient; *recipient = nullptr; void AIBinder_DeathRecipient_delete(AIBinder_DeathRecipient* recipient) { delete recipient; } libs/binder/ndk/include_ndk/android/binder_ibinder.h +2 −2 Original line number Diff line number Diff line Loading @@ -300,7 +300,7 @@ __attribute__((warn_unused_result)) AIBinder_Weak* AIBinder_Weak_new(AIBinder* b /** * Deletes the weak reference. This will have no impact on the lifetime of the binder. */ void AIBinder_Weak_delete(AIBinder_Weak** weakBinder); void AIBinder_Weak_delete(AIBinder_Weak* weakBinder); /** * If promotion succeeds, result will have one strong refcount added to it. Otherwise, this returns Loading @@ -323,7 +323,7 @@ __attribute__((warn_unused_result)) AIBinder_DeathRecipient* AIBinder_DeathRecip * Deletes a binder death recipient. It is not necessary to call AIBinder_unlinkToDeath before * calling this as these will all be automatically unlinked. */ void AIBinder_DeathRecipient_delete(AIBinder_DeathRecipient** recipient); void AIBinder_DeathRecipient_delete(AIBinder_DeathRecipient* recipient); __END_DECLS Loading libs/binder/ndk/include_ndk/android/binder_parcel.h +2 −2 Original line number Diff line number Diff line Loading @@ -45,9 +45,9 @@ struct AParcel; typedef struct AParcel AParcel; /** * Cleans up a parcel and sets it to nullptr. * Cleans up a parcel. */ void AParcel_delete(AParcel** parcel); void AParcel_delete(AParcel* parcel); /** * Writes an AIBinder to the next location in a non-null parcel. Can be null. Loading libs/binder/ndk/include_ndk/android/binder_status.h +1 −1 Original line number Diff line number Diff line Loading @@ -177,7 +177,7 @@ const char* AStatus_getMessage(const AStatus* status); /** * Deletes memory associated with the status instance. */ void AStatus_delete(AStatus** status); void AStatus_delete(AStatus* status); __END_DECLS Loading libs/binder/ndk/parcel.cpp +2 −7 Original line number Diff line number Diff line Loading @@ -27,13 +27,8 @@ using ::android::Parcel; using ::android::sp; using ::android::status_t; void AParcel_delete(AParcel** parcel) { if (parcel == nullptr) { return; } delete *parcel; *parcel = nullptr; void AParcel_delete(AParcel* parcel) { delete parcel; } binder_status_t AParcel_writeStrongBinder(AParcel* parcel, AIBinder* binder) { Loading Loading
libs/binder/ndk/ibinder.cpp +10 −15 Original line number Diff line number Diff line Loading @@ -198,13 +198,8 @@ AIBinder_Weak* AIBinder_Weak_new(AIBinder* binder) { return new AIBinder_Weak{wp<AIBinder>(binder)}; } void AIBinder_Weak_delete(AIBinder_Weak** weakBinder) { if (weakBinder == nullptr) { return; } delete *weakBinder; *weakBinder = nullptr; void AIBinder_Weak_delete(AIBinder_Weak* weakBinder) { delete weakBinder; } AIBinder* AIBinder_Weak_promote(AIBinder_Weak* weakBinder) { if (weakBinder == nullptr) { Loading Loading @@ -437,6 +432,11 @@ binder_status_t AIBinder_prepareTransaction(AIBinder* binder, AParcel** in) { return ret; } static void DestroyParcel(AParcel** parcel) { delete *parcel; *parcel = nullptr; } binder_status_t AIBinder_transact(AIBinder* binder, transaction_code_t code, AParcel** in, AParcel** out, binder_flags_t flags) { if (in == nullptr) { Loading @@ -447,7 +447,7 @@ binder_status_t AIBinder_transact(AIBinder* binder, transaction_code_t code, APa using AutoParcelDestroyer = std::unique_ptr<AParcel*, void (*)(AParcel**)>; // This object is the input to the transaction. This function takes ownership of it and deletes // it. AutoParcelDestroyer forIn(in, AParcel_delete); AutoParcelDestroyer forIn(in, DestroyParcel); if (!isUserCommand(code)) { LOG(ERROR) << __func__ << ": Only user-defined transactions can be made from the NDK."; Loading Loading @@ -492,11 +492,6 @@ AIBinder_DeathRecipient* AIBinder_DeathRecipient_new( return new AIBinder_DeathRecipient(onBinderDied); } void AIBinder_DeathRecipient_delete(AIBinder_DeathRecipient** recipient) { if (recipient == nullptr) { return; } delete *recipient; *recipient = nullptr; void AIBinder_DeathRecipient_delete(AIBinder_DeathRecipient* recipient) { delete recipient; }
libs/binder/ndk/include_ndk/android/binder_ibinder.h +2 −2 Original line number Diff line number Diff line Loading @@ -300,7 +300,7 @@ __attribute__((warn_unused_result)) AIBinder_Weak* AIBinder_Weak_new(AIBinder* b /** * Deletes the weak reference. This will have no impact on the lifetime of the binder. */ void AIBinder_Weak_delete(AIBinder_Weak** weakBinder); void AIBinder_Weak_delete(AIBinder_Weak* weakBinder); /** * If promotion succeeds, result will have one strong refcount added to it. Otherwise, this returns Loading @@ -323,7 +323,7 @@ __attribute__((warn_unused_result)) AIBinder_DeathRecipient* AIBinder_DeathRecip * Deletes a binder death recipient. It is not necessary to call AIBinder_unlinkToDeath before * calling this as these will all be automatically unlinked. */ void AIBinder_DeathRecipient_delete(AIBinder_DeathRecipient** recipient); void AIBinder_DeathRecipient_delete(AIBinder_DeathRecipient* recipient); __END_DECLS Loading
libs/binder/ndk/include_ndk/android/binder_parcel.h +2 −2 Original line number Diff line number Diff line Loading @@ -45,9 +45,9 @@ struct AParcel; typedef struct AParcel AParcel; /** * Cleans up a parcel and sets it to nullptr. * Cleans up a parcel. */ void AParcel_delete(AParcel** parcel); void AParcel_delete(AParcel* parcel); /** * Writes an AIBinder to the next location in a non-null parcel. Can be null. Loading
libs/binder/ndk/include_ndk/android/binder_status.h +1 −1 Original line number Diff line number Diff line Loading @@ -177,7 +177,7 @@ const char* AStatus_getMessage(const AStatus* status); /** * Deletes memory associated with the status instance. */ void AStatus_delete(AStatus** status); void AStatus_delete(AStatus* status); __END_DECLS Loading
libs/binder/ndk/parcel.cpp +2 −7 Original line number Diff line number Diff line Loading @@ -27,13 +27,8 @@ using ::android::Parcel; using ::android::sp; using ::android::status_t; void AParcel_delete(AParcel** parcel) { if (parcel == nullptr) { return; } delete *parcel; *parcel = nullptr; void AParcel_delete(AParcel* parcel) { delete parcel; } binder_status_t AParcel_writeStrongBinder(AParcel* parcel, AIBinder* binder) { Loading