Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c57d1a9e authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge "libbinder: size checks for Parcel+IBinder" am: 64117a8d am:...

Merge "libbinder: size checks for Parcel+IBinder" am: 64117a8d am: d2a1a455 am: 4347f645 am: 316bdbd6

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1694225

Change-Id: Ie595475e57a13e34e35008b9c56ba35677acf8e7
parents 7875af78 316bdbd6
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -29,6 +29,16 @@

namespace android {

// Service implementations inherit from BBinder and IBinder, and this is frozen
// in prebuilts.
#ifdef __LP64__
static_assert(sizeof(IBinder) == 24);
static_assert(sizeof(BBinder) == 40);
#else
static_assert(sizeof(IBinder) == 12);
static_assert(sizeof(BBinder) == 20);
#endif

// ---------------------------------------------------------------------------

IBinder::IBinder()
+5 −1
Original line number Diff line number Diff line
@@ -78,7 +78,11 @@ static size_t pad_size(size_t s) {
namespace android {

// many things compile this into prebuilts on the stack
static_assert(sizeof(Parcel) == 60 || sizeof(Parcel) == 120);
#ifdef __LP64__
static_assert(sizeof(Parcel) == 120);
#else
static_assert(sizeof(Parcel) == 60);
#endif

static std::atomic<size_t> gParcelGlobalAllocCount;
static std::atomic<size_t> gParcelGlobalAllocSize;