bad-alloc
std::bad_alloc not getting caught in any calling stackframe
If the new operator fails to allocate memory, the exception std::bad_alloc is only getting caught if I put a try-catch block immediately surrounding the new statement. If I instead have the try-catch[详细]
2023-03-23 00:04 分类:问答std::bad_alloc when adding a struct to std::vector
this is probably something stupid, but i can\'t figure it out. I\'m getting a std::bad_alloc exception in the following code snippet (which is a case statement in a switch):[详细]
2023-02-28 01:44 分类:问答C++ array of derived class vs array of pointers of base class to derived objects - why is amount of memory allocated so much different?
I need some clarification on an issue I don\'t quite understand. Using the two scenarios that follow, I would have thought that the amount of memory allocated would roughly be the same. However, scena[详细]
2023-02-27 06:09 分类:问答bad_alloc when calling new on class Texture
This is the offending line: Texture *texture = new Texture (...); I receive from bad_alloc here: void *__CRTDECL operator new(size_t size) _THROW1(_STD bad_alloc)[详细]
2023-02-09 18:50 分类:问答Is it okay to manually throw an std::bad_alloc?
I have this code.. CEngineLayer::CEngineLayer(void) { // Incoming creation of layers. Wrapping all of this in a try/catch block is[详细]
2023-01-28 04:56 分类:问答Mergesort - std::bad_alloc thrown when trying to assign vector
Good afternoon ladies and gents. So, it is not my day for errors. Implementing Mergesort (not in-place) in C++, and I\'m having real trouble with the code, with no idea why. The second-to-last line of[详细]
2023-01-12 03:34 分类:问答Bad_alloc exception when using new for a struct c++
I am writing a query processor which allocates large amounts of memory and tries to find matching documents. Whenever I find a match, I create a structure to hold two variables describing the document[详细]
2022-12-25 09:14 分类:问答Debugging strategy to find the cause of bad_alloc
I have a fairly serious bug in my program - occasional calls to new() throw a bad_alloc. From the documentation开发者_如何学Python I can find on bad_alloc, it seems to be thrown for these reasons:[详细]
2022-12-23 07:13 分类:问答bad_alloc exception when trying to print the values
I\'ve debugged my other problem back, to the MyMesh constructor. In this code: if (hollow) { numTriangles = n*8;[详细]
2022-12-11 17:48 分类:问答How can I debug St9bad_alloc failures in gdb in C?
I have a program failing with: terminate called after throwing an instance of \'std::bad_alloc\' what():St9bad_alloc[详细]
2022-12-10 11:36 分类:问答