From 485b5a9c2fc1840255a0fe2fe7a1dd3f4d0e0130 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 11 Nov 2009 21:15:58 +0000 Subject: (svn r18045) -Fix: GCC 4.5@HEAD not compiling OpenTTD anymore because of a "non-placement deallocation function [is] selected for placement delete", or in other words delete(void *, size_t) is 'magic'. We implemented these delete(void *, size_t) operator functions because MSVC warned that "no matching operator delete found; memory will not be freed if initialization throws an exception" for new(size_t, size_t). This disables MSVC warning about this because we do not use exceptions in the (constructors that use the) overridden allocation functions, as such they will never be called; delete(void *) remains necessary though. --- src/core/pool_type.hpp | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'src/core') diff --git a/src/core/pool_type.hpp b/src/core/pool_type.hpp index 58a58f6ac..9c32a81df 100644 --- a/src/core/pool_type.hpp +++ b/src/core/pool_type.hpp @@ -118,20 +118,6 @@ struct Pool { return Tpool->GetNew(size, index); } - /** - * Deletes item with given index. - * @param p Titem memory to release - * @param index index of item - * @note never use this! Only for internal use - * (called automatically when constructor of Titem uses throw()) - */ - FORCEINLINE void operator delete(void *p, size_t index) - { - assert(p == Tpool->Get(index)); - Tpool->FreeItem(index); - } - - /** * Allocates space for new Titem at given memory address * @param size size of Titem @@ -154,21 +140,6 @@ struct Pool { return ptr; } - /** - * Deletes item that was allocated by the function above - * @param p Titem memory to release - * @param ptr parameter given to operator new - * @note never use this! Only for internal use - * (called automatically when constructor of Titem uses throw()) - */ - FORCEINLINE void operator delete(void *p, void *ptr) - { - assert(p == ptr); - for (size_t i = 0; i < Tpool->first_unused; i++) { - assert(ptr != Tpool->data[i]); - } - } - /** Helper functions so we can use PoolItem::Function() instead of _poolitem_pool.Function() */ -- cgit v1.2.3-70-g09d2