ArticleslgStudy

computer science

Bionic (software)

Bionic (software) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Bionic (software) rather than just read about it. In short: Bionic is an implementation of the C standard library, developed by Google for its Android operating system. It differs from the GNU C Library (glibc) in being designed for devices with less memory and processor power than a typical Linux system.

Key takeaways

  • Bionic (software) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Bionic (software) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Bionic (software) from memory before moving on to harder problems.

Reference excerpt

Bionic is an implementation of the C standard library, developed by Google for its Android operating system. It differs from the GNU C Library (glibc) in being designed for devices with less memory and processor power than a typical Linux system. It is a combination of new code and code from FreeBSD, NetBSD, and OpenBSD released under a BSD license, rather than glibc, which uses the GNU Lesser General Public License. This difference was important in the early days of Android, when static linking was common, and since Bionic has its own application binary interface, it cannot be replaced by a different libc without breaking all existing apps. Bionic is a C library for use with the Linux kernel, and provides libc, libdl, and libm (libpthread functionality is part of libc, not a separate library as on some other systems). This differs from the BSD C libraries that Bionic shares code with, because they require a BSD kernel.

Original goals The original publicly stated goals for Bionic were the following:

BSD-licensed: Google wanted to isolate Android applications from the effect of copyleft licenses to create a proprietary user-space and application ecosystem, but: Android is based on the Linux kernel, which is subject to the copyleft GNU General Public License (GPL) version 2. The most widespread standard C library for the Linux kernel is the GNU C Library (glibc), which is subject to the GNU Lesser General Public License (LGPL), also a copyleft license. In contrast to the GPL, the LGPL explicitly allows for dynamic linking but it does not allow static linking of proprietary software without providing source code or linkable object files. The permissive BSD license is a non-copyleft license that is compatible in both directions. A BSD-licensed glibc substitute could act as an isolation layer between the copyleft core (kernel) and the non-copyleft applications, and was therefore chosen by Google for its Bionic as a glibc substitute. Small size: Bionic was much smaller than the GNU C Library; more importantly its memory requirements were (and remain) much lower. Speed: Bionic was designed for CPUs at relatively low clock frequencies.

Supported architectures Bionic only supports Linux kernels, but currently supports the arm, arm64, riscv64, x86, and x86-64 architectures. The platform itself required armv7 with Neon since Marshmallow, though the Android Native Development Kit (NDK) continued to support armv5 (which it called armeabi) up until NDK r16. The NDK still supports armv7, though NDK r24 dropped support for non-Neon. Historically there was partial SH-4 support in the platform, but no devices ever shipped and support has since been removed. The NDK never supported SH-4, and MIPS and MIPS64 support were removed from the NDK in r17.

Components Some parts of the libc source, such as stdio, are from the BSDs (mainly OpenBSD), whereas others, such as the pthread implementation, were written from scratch. The dynamic memory allocator implementation has changed over time. Releases predating Lollipop include a single native memory allocator, Doug Lea's dlmalloc. For Lollipop and Marshmallow include two implementations: dlmalloc and jemalloc. jemalloc gives much higher performance than dlmalloc, but at the cost of extra memory required for bookkeeping. Most devices switched to jemalloc but low-memory devices did not switch away from dlmalloc. For Nougat through Android 10, all devices use jemalloc. Low-memory devices use a "svelte" configuration of jemalloc that disables the tcache to nearly match the lower memory overhead of dlmalloc while keeping most of the speed of jemalloc. In Android 11, the memory allocator for most devices was switched to Scudo, which sacrifices some of jemalloc's high performance for additional security hardening features. Low-memory devices, however, are still permitted to use jemalloc. Some 64-bit devices, like the Nexus 9, are effectively low-memory devices because of the extra space requirements of 64-bit pointers and hosting of two zygotes. (Zygote is an Android system service that is the parent of all Android application processes.) The libm source is largely FreeBSD's, but with optimized assembler contributed by the various SoC vendors. The dynamic linker (and libdl) were written from scratch. Bionic doesn't include libthread_db (used by gdbserver), but the NDK does. The Android platform includes a statically linked gdbserver, so that developers can use the latest gdb even on old devices. Since Android dropped gdb support and switched to lldb, this is no longer relevant in subsequent releases. There is no separate libpthread, libresolv, or librt on Android – the functionality is all in libc. For libpthread, there is no attempt to optimize for the single-threaded case because apps are in a multi-threaded environment even before the first instruction of third-party code is ever run. The Android platform uses libc++ for the C++ standard library (releases up to and including Lollipop used stlport). The NDK historically offered stlport and GNU libstdc++, but those are not longer included in NDK r18 and later releases. Note that if any native code in an Android app uses C++, all the C++ must use the same STL. The STL is not provided by the Android OS, and must be bundled with each app.

Differences from POSIX Although Bionic aims to implement all of C11 and POSIX, there are still (as of Android 15) about 11 POSIX functions missing from libc. There are also POSIX functions such as the endpwent/getpwent/setpwent family that are inapplicable to Android because it lacks a passwd database. As of Oreo, libm is complete. Some functions deliberately do not conform to the POSIX or C standards for security reasons, such as printf which does not support the %n format string. Many of the most-used GNU extensions are implemented in Bionic, as are various BSD extensions.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Bionic (software)

Start with the simplest possible case. Write down what Bionic (software) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Bionic (software) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Bionic (software) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Bionic (software)

In research
Bionic (software) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Bionic (software) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Bionic (software) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Android (operating system), C standard library, Interfaces of the Linux kernel, so understanding it makes those chapters shorter.
In everyday life
Look for Bionic (software) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Bionic (software)” →

How to study Bionic (software) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Bionic (software) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Bionic (software) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Bionic (software) in simple terms?

Bionic is an implementation of the C standard library, developed by Google for its Android operating system. It differs from the GNU C Library (glibc) in being designed for devices with less memory and processor power than a typical Linux system.

Why does Bionic (software) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Bionic (software)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Bionic (software).

Tags

  • Android (operating system)
  • C standard library
  • Interfaces of the Linux kernel
  • Software using the BSD license

Keep exploring