calling new when heap is full

Hi, I want to know what happens when we call new when the heap is full. Do we get a core dump or does the program just stops or what exactly?
Thanks
Last edited on
closed account (48bpfSEw)
1
2
3
4
5
6
7
8
9
10
11
12
13
(1) throwing allocation
    Allocates size bytes of storage, suitably aligned to represent any object of that size, and returns a non-null pointer to the first byte of this block.
    On failure, it throws a bad_alloc exception.
(2) nothrow allocation
    Same as above (1), except that on failure it returns a null pointer instead of throwing an exception.

        C++98
        C++11

    If replaced, both the first and second versions shall return pointers with identical properties.
(3) placement
    Simply returns ptr (no storage is allocated).
    Notice though that, if the function is called by a new-expression, the proper initialization will be performed (for class objects, this includes calling its default constructor).


http://www.cplusplus.com/reference/new/operator%20new/

Last edited on
thanks mate.
Topic archived. No new replies allowed.