Skip to content

Commit

Permalink
prevent memory fragmentation
Browse files Browse the repository at this point in the history
  • Loading branch information
FrenkelS committed May 12, 2024
1 parent a5c3d85 commit 13600de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doomdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
* Copyright 2005, 2006 by
* Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko
* Copyright 2023 by
* Copyright 2023, 2024 by
* Frenkel Smeijers
*
* This program is free software; you can redistribute it and/or
Expand Down
4 changes: 2 additions & 2 deletions p_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,14 +295,14 @@ typedef char assertLineSize[sizeof(packed_line_t) == 47 ? 1 : -1];

static void P_LoadLineDefs(int16_t lump)
{
const packed_line_t __far* lines = W_GetLumpByNum(lump);

_g_numlines = W_LumpLength(lump) / sizeof(packed_line_t);
_g_lines = Z_MallocLevel(_g_numlines * sizeof(line_t), NULL);
_g_linedata = Z_CallocLevel(_g_numlines * sizeof(linedata_t));

line_t __far* _w_lines = (line_t __far*) _g_lines;

const packed_line_t __far* lines = W_GetLumpByNum(lump);

for (int16_t i = 0; i < _g_numlines; i++)
{
_w_lines[i].v1 = lines[i].v1;
Expand Down

0 comments on commit 13600de

Please sign in to comment.