diff options
| -rw-r--r-- | libs/binder/Binder.cpp | 10 | ||||
| -rw-r--r-- | libs/binder/Parcel.cpp | 6 |
2 files changed, 15 insertions, 1 deletions
diff --git a/libs/binder/Binder.cpp b/libs/binder/Binder.cpp index d964d255fe..d5bdd1c803 100644 --- a/libs/binder/Binder.cpp +++ b/libs/binder/Binder.cpp @@ -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() diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 98ca829031..39d6a2ec4f 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -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; |