Small fix to operator new

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@89 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
tslettebo 2003-01-25 12:56:30 +00:00
parent 8b5dacc522
commit 20107644b0
2 changed files with 16 additions and 7 deletions

View file

@ -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

View file

@ -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 <cstddef>
#include <vector>
#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;