From 02c0553977c048180383ecca0c29b5926b866146 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 18 Nov 2020 23:06:21 +0100 Subject: [PATCH] saves: Remove noop allocation/deallocation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compilers (at least gcc 10) were already reaching that conclusion, so this shouldn’t change code generation at all. This piece of code got introduced in commit 3eb9de46148714fc364da2d4fcb1ffff5ecf37c5 when upgrading to save state version 1 (we’re at version 12), and commit 64073a2558df7331f5b001296a371e0f50cdf3c9 added some OOP on top of it so that cp15 was in charge of handling that memory. The code never got cleaned until now. --- desmume/src/saves.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/desmume/src/saves.cpp b/desmume/src/saves.cpp index a795e48c7..27c3f6e46 100644 --- a/desmume/src/saves.cpp +++ b/desmume/src/saves.cpp @@ -624,17 +624,8 @@ static bool cp15_loadstate(EMUFILE &is, int size) if (version == 0) { //ARM7 not have coprocessor - - // TODO: What's going on here with tmp_buf? - u8 *tmp_buf = new u8 [sizeof(armcp15_t)]; - if (!tmp_buf) return false; - if (!cp15.loadone(is)) - { - delete [] tmp_buf; return false; - } - delete [] tmp_buf; } return true;