Neo wrote:
Hello,
I have a question on memory allocation for containers. I know what
happens when I ask for a container of a certain size or when the
container grows to accommodate new elements. The question I had is
what does the OS do when an application requests for memory, for ex
OS?
Not yet
IMHO, they can be layered as the following:
Container
| Standard C++ Library
Allocator
|
(new/delete optional)
---------------------------------------------
|
malloc/free/[alloc/realloc] (seldom used) Standard C Library
|
---------------------------------------------
|
crt implementation calls OS APIs C-Runtime
|
---------------------------------------------
OS
from a code using stls? Does the application get what it requests ?
memory may exhaust, so allocation may fail, the failure passed up from
OS API calls to the upper layers
and where does the memory provided reside, will it be in the memory
allocated to the application?
It depends, like vector deque, at a certain time they have memory reside
like set list, they don't
or will it enlarge the memory allocated
to the app?
But I guess your using "applicatio n" here is not appropriate, forgive my
English, I can't describe this to you.