bad_alloc in these situations?

Discussion in 'C Programming' started by George2, Feb 28, 2008.

  1. George2

    George2

    Joined:
    Feb 12, 2008
    Messages:
    108
    Hello everyone,


    In these situations, whether bad_alloc will be thrown?

    1. Memory is reserved, even if not used. No "enough" memory to new operator (which reflects not enough memory for VirtualAlloc, even if not used (committed), but reserved);

    2. The heap's internal data structures could be corrupted such that it cannot find the next free block (no pointer to the next free block), which would make it think it is out of memory.

    3. The heap's internal data structures could be corrupted so that it points to random memory location, which could cause a crash, or try to give you memory that was still in use.

    My option, (1) and (2) will throw bad_alloc, for (3) structured exception (access violation) will be thrown?


    thanks in advance,
    George
     
    George2, Feb 28, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGFuaWVsIFdhbHplbmJhY2g=?=

    How to handle save situations in asp.net?

    =?Utf-8?B?RGFuaWVsIFdhbHplbmJhY2g=?=, Jul 21, 2004, in forum: ASP .Net
    Replies:
    12
    Views:
    962
    Steven Cheng[MSFT]
    Jul 27, 2004
  2. DigHazuse

    Validation on all PostBack situations

    DigHazuse, Nov 29, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    362
    DigHazuse
    Nov 29, 2005
  3. max
    Replies:
    11
    Views:
    604
    freemont
    Nov 11, 2006
  4. rana
    Replies:
    1
    Views:
    817
  5. apalopohapa
    Replies:
    0
    Views:
    558
    apalopohapa
    Oct 20, 2009
Loading...

Share This Page