Don't Let Memory Allocation Failures Crash Your Legacy STL Application
Forum » CSMP++ / C++ questions » Don't Let Memory Allocation Failures Crash Your Legacy STL Application
Started by: aliataliat
Date: 09 Oct 2009 09:50
Number of posts: 1
rss icon RSS: New posts
Summary:
Most C++ developers make extensive use of the Standard Template Library (STL) in their code. If you are one of them and are using STL and Visual C++ 6.0 directly out of the box, your application is at high risk of crashing under low memory conditions. The problem arises because checking for failure of operator new is such an uncommon practice. To make things worse, when new does fail, the response is not standard. Some language compilers return NULL while others throw an exception. In addition, if you are using STL in an MFC project, be aware that MFC has its own set of rules.
New Post
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License