[Scummvm-git-logs] scummvm master -> 2fcae50af1b8049be029ecbaa3cee8f0e3bd3861

mduggan mgithub at guarana.org
Sat Mar 28 11:51:24 UTC 2020


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

Summary:
af4bb06909 ULTIMA8: Header file cleanups
2fcae50af1 ULTIMA8: Remove valgrind-specific code


Commit: af4bb0690948c304fcc756ed6e5fa05613b0ff99
    https://github.com/scummvm/scummvm/commit/af4bb0690948c304fcc756ed6e5fa05613b0ff99
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2020-03-28T20:43:41+09:00

Commit Message:
ULTIMA8: Header file cleanups

Changed paths:
    engines/ultima/ultima8/audio/audio_mixer.cpp
    engines/ultima/ultima8/audio/midi_player.cpp
    engines/ultima/ultima8/graphics/texture.cpp
    engines/ultima/ultima8/misc/pent_include.h


diff --git a/engines/ultima/ultima8/audio/audio_mixer.cpp b/engines/ultima/ultima8/audio/audio_mixer.cpp
index c848067f25..886219a60b 100644
--- a/engines/ultima/ultima8/audio/audio_mixer.cpp
+++ b/engines/ultima/ultima8/audio/audio_mixer.cpp
@@ -26,7 +26,6 @@
 #include "ultima/ultima8/audio/music_process.h"
 #include "ultima/ultima8/audio/audio_channel.h"
 #include "ultima/ultima8/audio/midi_player.h"
-#include "ultima/ultima8/conf/setting_manager.h"
 #include "ultima/ultima8/kernel/kernel.h"
 #include "audio/decoders/raw.h"
 
diff --git a/engines/ultima/ultima8/audio/midi_player.cpp b/engines/ultima/ultima8/audio/midi_player.cpp
index 7703aaa70a..a9e9c67240 100644
--- a/engines/ultima/ultima8/audio/midi_player.cpp
+++ b/engines/ultima/ultima8/audio/midi_player.cpp
@@ -23,8 +23,6 @@
 #include "ultima/ultima8/audio/midi_player.h"
 #include "ultima/ultima8/ultima8.h"
 #include "audio/midiparser.h"
-#include "audio/miles.h"
-#include "common/config-manager.h"
 
 namespace Ultima {
 namespace Ultima8 {
diff --git a/engines/ultima/ultima8/graphics/texture.cpp b/engines/ultima/ultima8/graphics/texture.cpp
index aa67d27ec3..2430d9dc1a 100644
--- a/engines/ultima/ultima8/graphics/texture.cpp
+++ b/engines/ultima/ultima8/graphics/texture.cpp
@@ -27,8 +27,6 @@
 #include "ultima/ultima8/graphics/texture_png.h"
 #include "ultima/ultima8/graphics/render_surface.h"
 
-#include <cstring>
-
 namespace Ultima {
 namespace Ultima8 {
 
diff --git a/engines/ultima/ultima8/misc/pent_include.h b/engines/ultima/ultima8/misc/pent_include.h
index 46d49356be..1bd3a6c69f 100644
--- a/engines/ultima/ultima8/misc/pent_include.h
+++ b/engines/ultima/ultima8/misc/pent_include.h
@@ -23,8 +23,6 @@
 #ifndef ULTIMA8_MISC_PENT_INCLUDE_H
 #define ULTIMA8_MISC_PENT_INCLUDE_H
 
-#define PENTAGRAM_NEW
-
 //
 // Common/base types
 //
@@ -124,44 +122,6 @@ void setAllocationFunctions(allocFunc a, deallocFunc d);
 		pfree(ptr);                                          \
 	}
 
-//
-// Precompiled Header Support
-//
-#ifdef USE_PRECOMPILED_HEADER
-
-// C Standard Library and STL
-#include <fstream>
-#include <cstdio>
-#include "ultima/shared/std/containers.h"
-
-// Useful Pentagram headers
-#include "ultima/ultima8/world/get_object.h"
-#include "ultima/ultima8/kernel/kernel.h"
-#include "ultima/ultima8/usecode/intrinsics.h"
-#include "ultima/ultima8/kernel/process.h"
-#include "ultima/ultima8/kernel/object.h"
-#include "ultima/ultima8/world/item.h"
-#include "ultima/ultima8/world/container.h"
-#include "ultima/ultima8/world/actors/actor.h"
-#include "ultima/ultima8/world/actors/main_actor.h"
-#include "ultima/ultima8/gumps/gump.h"
-#include "ultima/ultima8/filesys/file_system.h"
-#include "ultima/ultima8/filesys/idata_source.h"
-#include "ultima/ultima8/filesys/odata_source.h"
-#include "ultima/ultima8/graphics/shape_archive.h"
-#include "ultima/ultima8/graphics/shape.h"
-#include "ultima/ultima8/graphics/shape_frame.h"
-#include "ultima/ultima8/graphics/render_surface.h"
-#include "ultima/ultima8/world/world.h"
-#include "ultima/ultima8/world/current_map.h"
-#include "ultima/ultima8/kernel/object_manager.h"
-#include "ultima/ultima8/ultima8.h"
-#include "ultima/ultima8/usecode/usecode.h"
-#include "ultima/ultima8/usecode/uc_list.h"
-#include "ultima/ultima8/usecode/uc_machine.h"
-#include "ultima/ultima8/usecode/uc_process.h"
-#endif
-
 } // End of namespace Ultima8
 } // End of namespace Ultima
 


Commit: 2fcae50af1b8049be029ecbaa3cee8f0e3bd3861
    https://github.com/scummvm/scummvm/commit/2fcae50af1b8049be029ecbaa3cee8f0e3bd3861
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2020-03-28T20:48:46+09:00

Commit Message:
ULTIMA8: Remove valgrind-specific code

Changed paths:
  R engines/ultima/ultima8/misc/pent_valgrind.h
    engines/ultima/ultima8/kernel/segmented_pool.cpp
    engines/ultima/ultima8/misc/pent_include.h


diff --git a/engines/ultima/ultima8/kernel/segmented_pool.cpp b/engines/ultima/ultima8/kernel/segmented_pool.cpp
index 443707cf4e..9fda22865d 100644
--- a/engines/ultima/ultima8/kernel/segmented_pool.cpp
+++ b/engines/ultima/ultima8/kernel/segmented_pool.cpp
@@ -37,18 +37,9 @@ DEFINE_RUNTIME_CLASSTYPE_CODE(SegmentedPool, Pool)
 
 #define OFFSET_ALIGN(X) ( (X + sizeof(uintptr) - 1) & ~(sizeof(uintptr) - 1) )
 
-#ifdef USE_VALGRIND
-const int redzoneSize = 8;
-#else
-const int redzoneSize = 0;
-#endif
-
 struct SegmentedPoolNode {
 	SegmentedPool *pool;
 	SegmentedPoolNode *nextFree;
-#ifdef USE_VALGRIND
-	int valgrind_handle;
-#endif
 	size_t size;
 };
 
@@ -61,17 +52,15 @@ SegmentedPool::SegmentedPool(size_t nodeCapacity_, uint32 nodes)
 
 	// Give it its real capacity.
 	// One redzone is added after the memory block.
-	_nodeCapacity = OFFSET_ALIGN(nodeCapacity_ + redzoneSize);
+	_nodeCapacity = OFFSET_ALIGN(nodeCapacity_);
 
 	// Node offsets are aligned to the next uintptr offset after the real size.
 	// Another redzone is added between the node and the memory block.
-	_nodeOffset = OFFSET_ALIGN(sizeof(SegmentedPoolNode) + redzoneSize) + _nodeCapacity;
+	_nodeOffset = OFFSET_ALIGN(sizeof(SegmentedPoolNode)) + _nodeCapacity;
 
 	_startOfPool = new uint8[_nodeOffset * nodes];
 	_endOfPool = _startOfPool + (_nodeOffset * nodes);
 
-	VALGRIND_CREATE_MEMPOOL(_startOfPool, redzoneSize, 0);
-
 	_firstFree = reinterpret_cast<SegmentedPoolNode *>(_startOfPool);
 	_firstFree->pool = this;
 	_firstFree->size = 0;
@@ -92,8 +81,6 @@ SegmentedPool::SegmentedPool(size_t nodeCapacity_, uint32 nodes)
 SegmentedPool::~SegmentedPool() {
 	assert(isEmpty());
 
-	VALGRIND_DESTROY_MEMPOOL(_startOfPool);
-
 	delete [] _startOfPool;
 }
 
@@ -118,13 +105,7 @@ void *SegmentedPool::allocate(size_t size) {
 
 //	debugN"Allocating Node 0x%08X\n", node);
 	uint8 *p = reinterpret_cast<uint8 *>(node) +
-	           OFFSET_ALIGN(sizeof(SegmentedPoolNode) + redzoneSize);
-
-	VALGRIND_MEMPOOL_ALLOC(_startOfPool, p, size);
-#ifdef USE_VALGRIND
-	node->valgrind_handle = VALGRIND_CREATE_BLOCK(p, size,
-	                        "SegmentedPoolBlock");
-#endif
+	           OFFSET_ALIGN(sizeof(SegmentedPoolNode));
 
 	return p;
 }
@@ -137,9 +118,6 @@ void SegmentedPool::deallocate(void *ptr) {
 		node->size = 0;
 		assert(node->pool == this);
 
-		VALGRIND_MEMPOOL_FREE(_startOfPool, ptr);
-		VALGRIND_DISCARD(node->valgrind_handle);
-
 //	debugN"Free Node 0x%08X\n", node);
 		if (isFull()) {
 			_firstFree = node;
diff --git a/engines/ultima/ultima8/misc/pent_include.h b/engines/ultima/ultima8/misc/pent_include.h
index 1bd3a6c69f..7ee2bb0a42 100644
--- a/engines/ultima/ultima8/misc/pent_include.h
+++ b/engines/ultima/ultima8/misc/pent_include.h
@@ -94,10 +94,6 @@
 //
 #define CANT_HAPPEN_MSG(msg) do { assert(msg && false); } while(0)
 
-//
-// Wrapper around valgrind functions.
-#include "ultima/ultima8/misc/pent_valgrind.h"
-
 namespace Ultima {
 namespace Ultima8 {
 
diff --git a/engines/ultima/ultima8/misc/pent_valgrind.h b/engines/ultima/ultima8/misc/pent_valgrind.h
deleted file mode 100644
index febab7fb41..0000000000
--- a/engines/ultima/ultima8/misc/pent_valgrind.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef PENT_VALGRIND_H
-#define PENT_VALGRIND_H
-
-#ifdef USE_VALGRIND
-
-#include <valgrind/memcheck.h>
-
-#else
-
-#define VALGRIND_MAKE_MEM_NOACCESS(_qzz_addr,_qzz_len)
-#define VALGRIND_MAKE_MEM_UNDEFINED(_qzz_addr,_qzz_len)
-#define VALGRIND_MAKE_MEM_DEFINED(_qzz_addr,_qzz_len)
-
-#define VALGRIND_CHECK_MEM_IS_DEFINED(_qzz_addr,_qzz_len)
-#define VALGRIND_CHECK_VALUE_IS_DEFINED(__lvalue)
-#define VALGRIND_CHECK_MEM_IS_ADDRESSABLE(_qzz_addr,_qzz_len)
-
-#define VALGRIND_CREATE_MEMPOOL(pool,rzB,is_zeroed)
-#define VALGRIND_DESTROY_MEMPOOL(pool)
-#define VALGRIND_MEMPOOL_ALLOC(pool,addr,size)
-#define VALGRIND_MEMPOOL_FREE(pool,addr)
-
-#define VALGRIND_CREATE_BLOCK(_qzz_addr,_qzz_len,_qzz_desc) 0
-#define VALGRIND_DISCARD(_qzz_blkindex)
-
-#endif
-
-#endif




More information about the Scummvm-git-logs mailing list