How we use C++
Typical candidates are image filters, audio processing, geometry for effects such as shattering objects and any algorithm that runs every frame. Written once in C++, the same module works on Android through the NDK and JNI and on iOS through an Objective-C++ wrapper.
Native code is where memory errors hide, so we build it with sanitizers enabled in test runs, keep the interface to the rest of the app narrow and measure before and after each optimisation, so speed gains are proven rather than assumed.
What we build with it
- Native modules for Android via NDK and JNI
- Shared libraries used by both Android and iOS
- Geometry, physics and particle effects
- Image and audio processing
Toolkit
- CMake
- Android NDK
- JNI
- Objective-C++
- GoogleTest
How we keep C++ code healthy
- AddressSanitizer and UndefinedBehaviorSanitizer in tests
- Benchmarks kept next to optimised code
- Narrow, documented interfaces to app code
- clang-tidy and clang-format in CI
Questions about C++
Does an app need C++ to be fast?
Rarely. We only move code to C++ after profiling shows a real bottleneck.
Can one C++ library serve Android and iOS?
Yes. The core is shared and each platform gets a thin wrapper.