From fa02c6433b186f06fb33748bc6e432b756c5c613 Mon Sep 17 00:00:00 2001 From: terminx Date: Thu, 27 Jul 2017 09:13:15 +0000 Subject: [PATCH] Switch allocation of sprite/wall/sector to individual aligned allocations instead of the weird thing I was doing with multiple pointers to different parts of a single large block git-svn-id: https://svn.eduke32.com/eduke32@6381 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/engine.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index b452a15a1..4200d1315 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -7633,6 +7633,7 @@ int32_t preinitengine(void) // Bprintf("FIXME: Allocating additional space beyond wall[] for editor bugs.\n"); } +#if 0 for (i=0; i<(signed)ARRAY_SIZE(dynarray); i++) size += dynarray[i].size; @@ -7646,6 +7647,13 @@ int32_t preinitengine(void) *dynarray[i].ptr = (int8_t *)blockptr + size; size += dynarray[i].size; } +#else + for (i = 0; i < (signed) ARRAY_SIZE(dynarray); i++) + { + Baligned_free(*dynarray[i].ptr); + *dynarray[i].ptr = Xaligned_alloc(16, dynarray[i].size); + } +#endif } #elif !defined DEBUG_MAIN_ARRAYS