From 20107644b0a529f6130f6053d1625d31c00505c0 Mon Sep 17 00:00:00 2001 From: tslettebo Date: Sat, 25 Jan 2003 12:56:30 +0000 Subject: [PATCH] Small fix to operator new git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@89 7ec92016-0320-0410-acc4-a06ded1c099a --- MSVC/1200/Readme.txt | 8 +++++++- MSVC/1200/SmallObj.h | 15 +++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/MSVC/1200/Readme.txt b/MSVC/1200/Readme.txt index 492f35b..f0eb91c 100644 --- a/MSVC/1200/Readme.txt +++ b/MSVC/1200/Readme.txt @@ -1,6 +1,6 @@ Loki VC 6.0 Port or how to produce C1001 - Internal Compiler Errors ------------------------------------------------------------------- -Version: 0.3 +Version: 0.3a Introduction/Compatibility: --------------------------- @@ -30,6 +30,12 @@ If you use Singletons with longevity you must add Singleton.cpp to your project/ Fixes: ------ + Jan 12, 2003: + ------------- + * changed the signature of SmallObject's op new. Now it + matches the corresponding op delete. + Thanks to M.Yamada for the hint and the solution. + Dec 08, 2002: ------------- * In HierarchyGenerators.h: Sergey Khachatrian reported a bug diff --git a/MSVC/1200/SmallObj.h b/MSVC/1200/SmallObj.h index 0f74b48..613a00a 100644 --- a/MSVC/1200/SmallObj.h +++ b/MSVC/1200/SmallObj.h @@ -13,7 +13,14 @@ // without express or implied warranty. //////////////////////////////////////////////////////////////////////////////// -// Last update: Oct 11, 2002 +// Last update: Jan 12, 2003 +// changed SmallObject's op new from +// static void* operator new(VC_BROKEN_STD::size_t size); +// to +// static void* operator new(VC_BROKEN_STD::size_t size, +// VC_BROKEN_STD::size_t dummy = 0); +// and removed the ugly #pragma warning(disable:4291)" +// Thanks to M.Yamada for the hint #ifndef SMALLOBJ_INC_ #define SMALLOBJ_INC_ @@ -23,10 +30,6 @@ #include "MSVC6Helpers.h" // for apply-template #include #include -#ifdef _MSC_VER -#define for if(0);else for -# pragma warning(disable:4291) -#endif #ifndef DEFAULT_CHUNK_SIZE #define DEFAULT_CHUNK_SIZE 4096 @@ -156,7 +159,7 @@ namespace Loki // DefaultLifetime, ThreadingModel*/> MyAllocator; public: - static void* operator new(VC_BROKEN_STD::size_t size) + static void* operator new(VC_BROKEN_STD::size_t size, VC_BROKEN_STD::size_t dummy = 0) { #if (MAX_SMALL_OBJECT_SIZE != 0) && (DEFAULT_CHUNK_SIZE != 0) typename MyThreadingModel::Lock lock;