I recently saw the following post:
A memory allocator isn't lower level than malloc. (The default allocator typically calls malloc directly or indirectly)
An allocator just allows you to specify different allocation strategies. For example, you might use an allocator which calls malloc once to retrieve a large pool of memory, and then for subsequent allocation requests, it just returns a small chunk of this pool.
Or you may use it as a hook to allow you to perform some additional task every time memory is allocated or freed.
As to your second question, malloc is the lowest you can go without losing portability. malloc is typically implemented using some OS-specific memory allocation function, so that would be lower level still. But that's unrelated to your main question, since C++ allocators are a higher-level abstraction.
from: C++: Memory allocators
My question is- how is malloc implemented in the following Operating systems?
- for Windows
- for Linux
what are the OS-specific functions which are called/implementations of malloc()?