The difference between malloc and dlmalloc

To allocate memory on the dalvik heap, applications use dlmalloc instead of the usual malloc, why dlmalloc is used, and how it differs from malloc. (As I know, malloc is used to highlight the dalvik heap when creating the dalvik VM.)

+7
source share
1 answer

The high-order bit was that Dalvik had to have a base allocator that was separated from the heap controlled by malloc by default, so it could have the right distribution control, knowing that the other subsystems would not interfere.

As it turned out, dlmalloc was a fairly mature existing library that provided isolation and the hooks we needed. The goal (up to the moment when I left the team) was that in the end we would replace it with something more intrusive, but this never became an urgent enough problem to make this particular dive.

Regarding the detailed differences between dlmalloc and malloc: dlmalloc is a specific implementation of the traditional libc malloc API, while "malloc" as such is not implementation specific. But even if you have specific ones, I doubt that I could offer anything more than "read the code."

+13
source

All Articles