This was compiled on 64 bit VS C++ 2015. std::bad_alloc occurs where x is specifically 1120
static std::vector<std::vector<std::vector<double>>> g_damagefunction;
static std::vector<std::vector<double>> g_has_damagefunction;
static std::vector<double> null_v_double;
static std::vector<bool> null_v_bool;
static std::vector<std::vector<double>> null_vv_double;
int main(){
for (int x = 0; x < 4400; x++) {
std::cout << x << '\n';
g_damagefunction.push_back(null_vv_double);
g_has_damagefunction.push_back(null_v_bool);
for (int y = 0; y < 2000; y++) {
g_damagefunction[x].push_back(null_v_double);
g_has_damagefunction[x].push_back(false);
for (int i = 0; i < 41; i++) {
g_damagefunction[x][y].push_back(0.0);
}
}
}
}