"AA" <ar********@gmail.comwrote in message
news:11*********************@q2g2000cwa.googlegrou ps.com...
: If a program is allocating memory in a loop, how to determine what is
: maximum memory allocation limit after which there will be out of
: memory eror ?
This is totally platform-dependent, and there is no way to predict
the available amount of memory using the standard C or C++ libraries
-- except by actually attempting the allocation.
malloc will return 0/NULL once it fails (while operator new
will throw an out-of-memory exception).
: Is malloc operation is user-mode or kernel-mode?
Again, this is a platform-dependent detail, and needs to
be looked up in the documentation of your library/compiler.
Try a platform-specific newsgroup, you might get an answer
there...
hth-Ivan
--
http://ivan.vecerina.com/contact/?subject=NG_POST <- email contact form
Brainbench MVP for C++ <
http://www.brainbench.com