Fix various issues related to stability when using highly compliant compilers such as Comeau 4.3.0.1, VC7.1 and GCC 3.2
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@108 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
80e63b12a3
commit
b53b3265e4
56 changed files with 441 additions and 203 deletions
|
@ -127,20 +127,6 @@ namespace Loki
|
|||
// allocations/deallocations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template
|
||||
<
|
||||
class ClientType,
|
||||
class ThreadingModelType
|
||||
>
|
||||
class SmallObjectStaticData
|
||||
{
|
||||
friend ClientType; // illegal (11.4/2) but works with VC
|
||||
static ThreadingModelType s_ThreadingModelData;
|
||||
};
|
||||
|
||||
template<class C, class M>
|
||||
M SmallObjectStaticData<C, M>::s_ThreadingModelData;
|
||||
|
||||
template
|
||||
<
|
||||
template <class> class ThreadingModel = DEFAULT_THREADING,
|
||||
|
@ -153,13 +139,6 @@ namespace Loki
|
|||
typedef ThreadingModel< SmallObject<ThreadingModel,
|
||||
chunkSize, maxSmallObjectSize> > MyThreadingModel;
|
||||
|
||||
typedef SmallObjectStaticData
|
||||
<
|
||||
SmallObject,
|
||||
MyThreadingModel
|
||||
>
|
||||
MySmallObjectStaticData;
|
||||
|
||||
struct MySmallObjAllocator : public SmallObjAllocator
|
||||
{
|
||||
MySmallObjAllocator()
|
||||
|
@ -175,8 +154,7 @@ namespace Loki
|
|||
static void* operator new(std::size_t size)
|
||||
{
|
||||
#if (MAX_SMALL_OBJECT_SIZE != 0) && (DEFAULT_CHUNK_SIZE != 0)
|
||||
typename MyThreadingModel::Lock lock(
|
||||
MySmallObjectStaticData::s_ThreadingModelData);
|
||||
typename MyThreadingModel::Lock lock;
|
||||
(void)lock; // get rid of warning
|
||||
|
||||
return SingletonHolder<MySmallObjAllocator, CreateStatic,
|
||||
|
@ -188,8 +166,7 @@ namespace Loki
|
|||
static void operator delete(void* p, std::size_t size)
|
||||
{
|
||||
#if (MAX_SMALL_OBJECT_SIZE != 0) && (DEFAULT_CHUNK_SIZE != 0)
|
||||
typename MyThreadingModel::Lock lock(
|
||||
MySmallObjectStaticData::s_ThreadingModelData);
|
||||
typename MyThreadingModel::Lock lock;
|
||||
(void)lock; // get rid of warning
|
||||
|
||||
SingletonHolder<MySmallObjAllocator, CreateStatic,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue