Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualKhatharr

Posted 29 December 2012 - 03:14 PM

If memory is not there, then you can't even allocate memory, otherwise if you have succesfully allocated memory with new then there is reserved memory size of the data type. I think you should perhaps think otherway around, how to ensure that there is memory before allocating or if program can't allocate memory then how to catch exceptions and what are actions to avoid useless deletions.

 

When he said 'is there' I think he meant 'is still allocated'. What he was really asking is if there's a way to check the status of an allocation, which for raw pointers is a 'no'. I don't think he's worried about the heap itself disappearing somewhere.


#1Khatharr

Posted 29 December 2012 - 03:12 PM

If memory is not there, then you can't even allocate memory, otherwise if you have succesfully allocated memory with new then there is reserved memory size of the data type. I think you should perhaps think otherway around, how to ensure that there is memory before allocating or if program can't allocate memory then how to catch exceptions and what are actions to avoid useless deletions.

 

When he said 'is there' I think he meant 'is still allocated'.


PARTNERS