C Extensions

The Android NDK comes with the GCC compiler (version 4.4.3 in release 7 of the NDK). As a consequence, you are able to use the C extensions the GNU Compiler Collection supports. Among the ones that are particularly interesting, as far as performance is concerned, are:

  • Built-in functions
  • Vector instructions

NOTE: Visit http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html for an exhaustive list of the GCC C extensions.

Built-in Functions

Built-in functions, sometimes referred to as intrinsics, are functions handled in a special manner by the compiler. Built-in functions are often used to allow for some constructs the language does not support, and are often inlined, that is, the compiler replaces the call with a series of instructions ...

Get Pro Android Apps Performance Optimization now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.