diff options
author | 2023-11-02 15:07:45 -0700 | |
---|---|---|
committer | 2023-11-03 09:40:33 -0700 | |
commit | df07f945b946fd1f7039d225ecd3de51a901ace7 (patch) | |
tree | 1f37c190b6cd567549cfd14f3efca5eeb18c19a7 /libs/binder/Utils.h | |
parent | d429f318b42341f27d035072193c2d5da0826e93 (diff) |
Binder: migrate off libbase macros
Test: mma
Bug: 302723053
Change-Id: Ie7c13c324311f600d72bc8ecc4157ad6c46259a0
Diffstat (limited to 'libs/binder/Utils.h')
-rw-r--r-- | libs/binder/Utils.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/binder/Utils.h b/libs/binder/Utils.h index 8942c31c48..68d639208e 100644 --- a/libs/binder/Utils.h +++ b/libs/binder/Utils.h @@ -45,6 +45,17 @@ namespace android { +/** + * Get the size of a statically initialized array. + * + * \param N the array to get the size of. + * \return the size of the array. + */ +template <typename T, size_t N> +constexpr size_t countof(T (&)[N]) { + return N; +} + // avoid optimizations void zeroMemory(uint8_t* data, size_t size); |