#include<iostream>
void out_of_mem(){
std::cerr<<"out of mem"<<std::endl;
std::abort();
}
int main(){
std::set_new_handler(out_of_mem);
char * p =new char [2000000000];
}
std::set_new_handler
最新推荐文章于 2024-03-31 14:38:38 发布
#include<iostream>
void out_of_mem(){
std::cerr<<"out of mem"<<std::endl;
std::abort();
}
int main(){
std::set_new_handler(out_of_mem);
char * p =new char [2000000000];
}