this post was submitted on 07 Jul 2023
13 points (93.3% liked)

Asklemmy

43757 readers
2316 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy ๐Ÿ”

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_A@discuss.tchncs.de~

founded 5 years ago
MODERATORS
 

I lately learned about memory allocations and use of malloc. The malloc command is defined in the POSIX standard, as can be seen here It says

The order and contiguity of storage allocated by successive calls to malloc() is unspecified.

So what is the default allocation strategy malloc uses on Linux. Is that allocation strategy different then from windows/ macOS or Android?

I heard malloc on Linux uses the Buddy memory allocation strategy is that true, since on wiki it only says the Linux Kernel uses it, but not Linux itself, idk?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] fiasco@possumpat.io 4 points 1 year ago

Userland malloc comes from libc, which is most likely glibc. Maybe this will tell you what you wanna know: https://sourceware.org/glibc/wiki/MallocInternals