bad_alloc in these situations?

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

  1. George2

    George2

    Joined:
    Feb 12, 2008
    Messages:
    108
    Likes Received:
    0
    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. Advertisements

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:
    1,134
    Steven Cheng[MSFT]
    Jul 27, 2004
  2. DigHazuse

    Validation on all PostBack situations

    DigHazuse, Nov 29, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    455
    DigHazuse
    Nov 29, 2005
  3. max
    Replies:
    11
    Views:
    798
    freemont
    Nov 11, 2006
  4. rana
    Replies:
    1
    Views:
    1,409
  5. apalopohapa
    Replies:
    0
    Views:
    661
    apalopohapa
    Oct 20, 2009
  6. tiago.private@gmail.com

    how to ignore postback data in particular situations

    tiago.private@gmail.com, Nov 15, 2008, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    925
    tiago.private@gmail.com
    Nov 15, 2008
  7. Matthew Horsfall
    Replies:
    4
    Views:
    204
    sln@netherlands.com
    Jul 14, 2010
  8. iMath
    Replies:
    2
    Views:
    201
    Ulrich Eckhardt
    Feb 8, 2013
Loading...