[Scummvm-git-logs] scummvm master -> d834b3bc2360de033131f27ce1216c2b0aac64d2

sev- noreply at scummvm.org
Sat Apr 29 20:54:44 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d834b3bc23 WATCHMAKER: Remove non-portable and unused allocated memory size tracker


Commit: d834b3bc2360de033131f27ce1216c2b0aac64d2
    https://github.com/scummvm/scummvm/commit/d834b3bc2360de033131f27ce1216c2b0aac64d2
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-04-29T22:54:01+02:00

Commit Message:
WATCHMAKER: Remove non-portable and unused allocated memory size tracker

Changed paths:
    engines/watchmaker/ll/ll_system.cpp


diff --git a/engines/watchmaker/ll/ll_system.cpp b/engines/watchmaker/ll/ll_system.cpp
index 85f30f3e6d0..011994504fb 100644
--- a/engines/watchmaker/ll/ll_system.cpp
+++ b/engines/watchmaker/ll/ll_system.cpp
@@ -19,17 +19,6 @@
  *
  */
 
-#ifdef __APPLE__
-#include <malloc/malloc.h>
-#define MALLOC_SIZE  malloc_size
-#else
-#include <malloc.h>
-#ifdef __linux__
-#define MALLOC_SIZE  malloc_usable_size
-#else
-#define MALLOC_SIZE  _msize
-#endif
-#endif
 #include "common/substream.h"
 #include "common/archive.h"
 #include "watchmaker/ll/ll_system.h"
@@ -39,8 +28,6 @@
 
 namespace Watchmaker {
 
-uint32 t3dAllocatedMemory = 0;
-
 char bUsingFastFile = 0;
 
 char bForceNOFastFile = 0;  // forza a non utilizzare il FastFile, nonostante questo sia attivo
@@ -55,8 +42,6 @@ void *t3dMalloc(uint32 n) {
 	if (!(res = static_cast<uint32 *>(malloc(n))))
 		warning("t3dMalloc: Can't alloc %d bytes", n);
 
-	t3dAllocatedMemory += n;
-
 	return (res);
 }
 
@@ -66,16 +51,12 @@ void *t3dCalloc(uint32 n) {
 	if (!(res = static_cast<uint32 *>(calloc(n, 1))))
 		warning("t3dCalloc: Can't alloc %d bytes", n);
 
-	t3dAllocatedMemory += n;
-
 	return (res);
 }
 
 void t3dFree(void *p) {
 	if (!p) return;
 
-	t3dAllocatedMemory -= (uint32) MALLOC_SIZE(p);
-
 	free(p);
 }
 
@@ -177,4 +158,4 @@ Common::SharedPtr<Common::SeekableReadStream> openFile(const Common::String &fil
 	return Common::SharedPtr<Common::SeekableReadStream>(file);
 }
 
-} // End of namespace Watchmaker
\ No newline at end of file
+} // End of namespace Watchmaker




More information about the Scummvm-git-logs mailing list