Skip to content

Commit

Permalink
CPU: Panic process on memory alloc fail
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Nov 28, 2023
1 parent d5fd867 commit 174f968
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/core/pgxp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "cpu_core.h"
#include "settings.h"

#include "common/assert.h"
#include "common/log.h"

#include <climits>
Expand Down Expand Up @@ -276,10 +277,7 @@ void PGXP::Initialize()
{
Mem = static_cast<PGXP_value*>(std::calloc(PGXP_MEM_SIZE, sizeof(PGXP_value)));
if (!Mem)
{
std::fprintf(stderr, "Failed to allocate PGXP memory\n");
std::abort();
}
Panic("Failed to allocate PGXP memory");
}

if (g_settings.gpu_pgxp_vertex_cache && !vertexCache)
Expand Down

0 comments on commit 174f968

Please sign in to comment.