osgx
osgx

Reputation: 94245

Android libc version and malloc implementation

What libc implementation is used in Android platform? What malloc implementation is used (ptmalloc or tcmalloc or anything other)?

Upvotes: 3

Views: 6418

Answers (1)

osgx
osgx

Reputation: 94245

libc is Bionic and malloc is Doug Lea version named dlmalloc (with USE_LOCKS enabled for thread-safety).

Update: dlmalloc was removed in january 2016: https://github.com/android/platform_bionic/commit/c650447239352d43acc2fd99a8579a85ae0469ab https://sourceforge.net/p/android-x86/bionic/ci/0ac0cee0d1ab60a92103a5021e76ec31da2e3234/ "Merge "Remove dlmalloc.""

+libc_malloc_src := bionic/jemalloc_wrapper.cpp
+libc_common_c_includes += external/jemalloc/include

So, Android 7 uses external malloc implementation jemalloc (from FreeBSD/Facebook) - http://jemalloc.net/ and https://github.com/jemalloc/jemalloc; android variant of code is there: https://android.googlesource.com/platform/external/jemalloc/

Upvotes: 7

Related Questions