3 ms·
What's wrong with the article is that malloc is not even a feature of Linux. There's mmap and brk, both of which have documented failure modes.
by shereadsthenews 7y ago
What's wrong with the article is that malloc is not even a feature of Linux. There's mmap and brk, both of which have documented failure modes.
- dragontamer 7y agoMost typical programmers will be using malloc, or some mechanism built on top of malloc (C++ new). MMap and brk are useful for certain situations (explicitly getting Huge Pages), but I don't think that the typical programmer necessarily needs to know about those. Since glibc malloc is built on top of mmap and brk, I think your distinction is mostly academic. For any programmer using Linux and glibc... malloc's failure mode IS mmap and brk failure modes.
- shereadsthenews 7y agoIt is a mischaracterization to say that C++ operator new is built on top of malloc. If your new is overridden by, say, tcmalloc, your program will never call malloc.
- zonidjan 7y agoIt is a feature of your chosen libc, which has to then interact with those system calls, in a way that gives malloc a peculiar behavior on Linux specifically as opposed to other OS.