Debugging strategy to find the cause of bad_alloc

前端 未结 6 731
Happy的楠姐
Happy的楠姐 2021-01-30 13:04

I have a fairly serious bug in my program - occasional calls to new() throw a bad_alloc.

From the documentation I can find on bad_alloc, it seems to be thrown for these

6条回答
  •  囚心锁ツ
    2021-01-30 13:30

    bad_alloc can be thrown by other code as well.

    I've seen it used by a limiting memory pool designed for use with STL containers. When the size limit was hit, it threw bad_alloc and the software just had to handle it.

提交回复
热议问题