Why does my program occasionally segfault when out of memory rather than throwing std::bad_alloc?

后端 未结 3 740
悲哀的现实
悲哀的现实 2021-01-11 16:32

I have a program that implements several heuristic search algorithms and several domains, designed to experimentally evaluate the various algorithms. The program is written

3条回答
  •  春和景丽
    2021-01-11 16:47

    What janneb said. In fact Linux by default never throws std::bad_alloc (or returns NULL from malloc()).

提交回复
热议问题