|
Boost-Commit : |
From: xushiweizh_at_[hidden]
Date: 2008-04-30 14:25:51
Author: xushiwei
Date: 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
New Revision: 44938
URL: http://svn.boost.org/trac/boost/changeset/44938
Log:
issue #1879:
I should have given a more complete description of reserved names:
* Any identifier containing a double underscore.
* Any identifier beginning with an underscore and a capital letter.
* All names beginning with an underscore in the global namespace.
Binary files modified:
sandbox/memory/libs/memory/lib/boost-memory.lib
Text files modified:
sandbox/memory/boost/memory.hpp | 60 ++++----
sandbox/memory/boost/memory/auto_alloc.hpp | 72 +++++-----
sandbox/memory/boost/memory/basic.hpp | 32 ++--
sandbox/memory/boost/memory/gc_alloc.hpp | 250 ++++++++++++++++++++--------------------
sandbox/memory/boost/memory/linklib.hpp | 10
sandbox/memory/boost/memory/policy.hpp | 36 ++--
sandbox/memory/boost/memory/scoped_alloc.hpp | 52 ++++----
sandbox/memory/boost/memory/stl/queue.hpp | 72 +++++-----
sandbox/memory/boost/memory/system_alloc.hpp | 22 +-
sandbox/memory/boost/memory/thread/tls.hpp | 30 ++--
sandbox/memory/boost/memory/threadmodel.hpp | 14 +-
sandbox/memory/boost/memory/threadmodel/multi_thread.hpp | 14 +-
sandbox/memory/boost/memory/threadmodel/single_thread.hpp | 12
sandbox/memory/boost/memory/winapi/posix/pthread.hpp | 8
sandbox/memory/boost/memory/winapi/winbase.h | 10
sandbox/memory/boost/memory/winapi/windef.h | 6
sandbox/memory/boost/memory/winapi/wtypes.h | 8
sandbox/memory/libs/memory/src/block_pool.cpp | 8
18 files changed, 358 insertions(+), 358 deletions(-)
Modified: sandbox/memory/boost/memory.hpp
==============================================================================
--- sandbox/memory/boost/memory.hpp (original)
+++ sandbox/memory/boost/memory.hpp 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -9,45 +9,45 @@
//
// See http://www.boost.org/libs/memory/index.htm for documentation.
//
-#ifndef _BOOST_MEMORY_HPP_
-#define _BOOST_MEMORY_HPP_
+#ifndef BOOST_MEMORY_HPP
+#define BOOST_MEMORY_HPP
// -------------------------------------------------------------------------
-#ifndef _BOOST_MEMORY_AUTO_ALLOC_HPP_
+#ifndef BOOST_MEMORY_AUTO_ALLOC_HPP
#include "memory/auto_alloc.hpp"
#endif
-#ifndef _BOOST_MEMORY_SCOPED_ALLOC_HPP_
+#ifndef BOOST_MEMORY_SCOPED_ALLOC_HPP
#include "memory/scoped_alloc.hpp"
#endif
-#ifndef _BOOST_MEMORY_GC_ALLOC_HPP_
+#ifndef BOOST_MEMORY_GC_ALLOC_HPP
#include "memory/gc_alloc.hpp"
#endif
// -------------------------------------------------------------------------
// class stl_alloc
-_NS_BOOST_BEGIN
+NS_BOOST_BEGIN
-template <class _Ty, class _Alloc = scoped_alloc>
+template <class Type, class AllocT = scoped_alloc>
class stl_alloc
{
private:
- _Alloc* m_alloc;
+ AllocT* m_alloc;
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
- typedef _Ty* pointer;
- typedef const _Ty* const_pointer;
- typedef _Ty& reference;
- typedef const _Ty& const_reference;
- typedef _Ty value_type;
+ typedef Type* pointer;
+ typedef const Type* const_pointer;
+ typedef Type& reference;
+ typedef const Type& const_reference;
+ typedef Type value_type;
template <class U>
- struct rebind { typedef stl_alloc<U, _Alloc> other; };
+ struct rebind { typedef stl_alloc<U, AllocT> other; };
public:
pointer address(reference val) const
@@ -56,29 +56,29 @@
{ return &val; }
size_type max_size() const
- { size_type count = (size_type)(-1) / sizeof (_Ty);
+ { size_type count = (size_type)(-1) / sizeof (Type);
return (0 < count ? count : 1); }
public:
- stl_alloc(_Alloc& alloc) : m_alloc(&alloc) {}
+ stl_alloc(AllocT& alloc) : m_alloc(&alloc) {}
template <class U>
- stl_alloc(const stl_alloc<U, _Alloc>& rhs) : m_alloc(rhs._Getalloc()) {}
+ stl_alloc(const stl_alloc<U, AllocT>& rhs) : m_alloc(rhs._Getalloc()) {}
pointer allocate(size_type count, const void* = NULL)
- { return (pointer)m_alloc->allocate(count * sizeof(_Ty)); }
+ { return (pointer)m_alloc->allocate(count * sizeof(Type)); }
void deallocate(void* p, size_type cb)
{ m_alloc->deallocate(p, cb); }
- void construct(pointer p, const _Ty& val)
- { new(p) _Ty(val); }
+ void construct(pointer p, const Type& val)
+ { new(p) Type(val); }
void destroy(pointer p)
- { p->~_Ty(); }
+ { p->~Type(); }
public:
char* _Charalloc(size_type cb)
{ return (char*)m_alloc->allocate(cb); }
- _Alloc* _Getalloc() const { return m_alloc; }
+ AllocT* _Getalloc() const { return m_alloc; }
};
template<> class stl_alloc<void, scoped_alloc>
@@ -101,21 +101,21 @@
struct rebind { typedef stl_alloc<U, scoped_alloc> other; };
};
-template <class _Ty, class _Alloc>
-inline bool operator==(const stl_alloc<_Ty, _Alloc>&,
- const stl_alloc<_Ty, _Alloc>&) {
+template <class Type, class AllocT>
+inline bool operator==(const stl_alloc<Type, AllocT>&,
+ const stl_alloc<Type, AllocT>&) {
return true;
}
-template <class _Ty, class _Alloc>
-inline bool operator!=(const stl_alloc<_Ty, _Alloc>&,
- const stl_alloc<_Ty, _Alloc>&) {
+template <class Type, class AllocT>
+inline bool operator!=(const stl_alloc<Type, AllocT>&,
+ const stl_alloc<Type, AllocT>&) {
return false;
}
-_NS_BOOST_END
+NS_BOOST_END
// -------------------------------------------------------------------------
// $Log: memory.hpp,v $
-#endif /* _BOOST_MEMORY_HPP_ */
+#endif /* BOOST_MEMORY_HPP */
Modified: sandbox/memory/boost/memory/auto_alloc.hpp
==============================================================================
--- sandbox/memory/boost/memory/auto_alloc.hpp (original)
+++ sandbox/memory/boost/memory/auto_alloc.hpp 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -9,33 +9,33 @@
//
// See http://www.boost.org/libs/memory/index.htm for documentation.
//
-#ifndef _BOOST_MEMORY_AUTO_ALLOC_HPP_
-#define _BOOST_MEMORY_AUTO_ALLOC_HPP_
+#ifndef BOOST_MEMORY_AUTO_ALLOC_HPP
+#define BOOST_MEMORY_AUTO_ALLOC_HPP
-#ifndef _BOOST_MEMORY_SYSTEM_ALLOC_HPP_
+#ifndef BOOST_MEMORY_SYSTEM_ALLOC_HPP
#include "system_alloc.hpp"
#endif
-#ifndef _BOOST_MEMORY_POLICY_HPP_
+#ifndef BOOST_MEMORY_POLICY_HPP
#include "policy.hpp"
#endif
-_NS_BOOST_BEGIN
+NS_BOOST_BEGIN
// -------------------------------------------------------------------------
// class region_alloc
-template <class _Policy>
+template <class PolicyT>
class region_alloc
{
private:
- typedef typename _Policy::allocator_type _Alloc;
+ typedef typename PolicyT::allocator_type AllocT;
public:
- enum { MemBlockSize = _Policy::MemBlockSize };
+ enum { MemBlockSize = PolicyT::MemBlockSize };
enum { IsGCAllocator = TRUE };
- typedef _Alloc allocator_type;
+ typedef AllocT allocator_type;
private:
enum { HeaderSize = sizeof(void*) };
@@ -43,37 +43,37 @@
#pragma pack(1)
private:
- struct _MemBlock;
- friend struct _MemBlock;
+ struct MemBlock;
+ friend struct MemBlock;
- struct _MemBlock
+ struct MemBlock
{
- _MemBlock* pPrev;
+ MemBlock* pPrev;
char buffer[BlockSize];
};
- struct _DestroyNode
+ struct DestroyNode
{
- _DestroyNode* pPrev;
+ DestroyNode* pPrev;
destructor_t fnDestroy;
};
#pragma pack()
char* m_begin;
char* m_end;
- _DestroyNode* m_destroyChain;
- _Alloc m_alloc;
+ DestroyNode* m_destroyChain;
+ AllocT m_alloc;
private:
const region_alloc& operator=(const region_alloc&);
- _MemBlock* BOOST_MEMORY_CALL _ChainHeader() const
+ MemBlock* BOOST_MEMORY_CALL _chainHeader() const
{
- return (_MemBlock*)(m_begin - HeaderSize);
+ return (MemBlock*)(m_begin - HeaderSize);
}
- void BOOST_MEMORY_CALL _Init()
+ void BOOST_MEMORY_CALL _init()
{
- _MemBlock* pNew = (_MemBlock*)m_alloc.allocate(sizeof(_MemBlock));
+ MemBlock* pNew = (MemBlock*)m_alloc.allocate(sizeof(MemBlock));
pNew->pPrev = NULL;
m_begin = pNew->buffer;
m_end = (char*)pNew + m_alloc.alloc_size(pNew);
@@ -82,16 +82,16 @@
public:
region_alloc() : m_destroyChain(NULL)
{
- _Init();
+ _init();
}
- explicit region_alloc(_Alloc alloc) : m_alloc(alloc), m_destroyChain(NULL)
+ explicit region_alloc(AllocT alloc) : m_alloc(alloc), m_destroyChain(NULL)
{
- _Init();
+ _init();
}
explicit region_alloc(region_alloc& owner)
: m_alloc(owner.m_alloc), m_destroyChain(NULL)
{
- _Init();
+ _init();
}
~region_alloc()
@@ -111,14 +111,14 @@
{
while (m_destroyChain)
{
- _DestroyNode* curr = m_destroyChain;
+ DestroyNode* curr = m_destroyChain;
m_destroyChain = m_destroyChain->pPrev;
curr->fnDestroy(curr + 1);
}
- _MemBlock* pHeader = _ChainHeader();
+ MemBlock* pHeader = _chainHeader();
while (pHeader)
{
- _MemBlock* curr = pHeader;
+ MemBlock* curr = pHeader;
pHeader = pHeader->pPrev;
m_alloc.deallocate(curr);
}
@@ -150,8 +150,8 @@
{
if (cb >= BlockSize)
{
- _MemBlock* pHeader = _ChainHeader();
- _MemBlock* pNew = (_MemBlock*)m_alloc.allocate(HeaderSize + cb);
+ MemBlock* pHeader = _chainHeader();
+ MemBlock* pNew = (MemBlock*)m_alloc.allocate(HeaderSize + cb);
if (pHeader)
{
pNew->pPrev = pHeader->pPrev;
@@ -166,8 +166,8 @@
}
else
{
- _MemBlock* pNew = (_MemBlock*)m_alloc.allocate(sizeof(_MemBlock));
- pNew->pPrev = _ChainHeader();
+ MemBlock* pNew = (MemBlock*)m_alloc.allocate(sizeof(MemBlock));
+ pNew->pPrev = _chainHeader();
m_begin = pNew->buffer;
m_end = (char*)pNew + m_alloc.alloc_size(pNew);
}
@@ -177,7 +177,7 @@
void* BOOST_MEMORY_CALL allocate(size_t cb, destructor_t fn)
{
- _DestroyNode* pNode = (_DestroyNode*)allocate(sizeof(_DestroyNode) + cb);
+ DestroyNode* pNode = (DestroyNode*)allocate(sizeof(DestroyNode) + cb);
pNode->fnDestroy = fn;
pNode->pPrev = m_destroyChain;
m_destroyChain = pNode;
@@ -203,7 +203,7 @@
// no action
}
- _BOOST_FAKE_DBG_ALLOCATE();
+ BOOST_FAKE_DBG_ALLOCATE_();
};
// -------------------------------------------------------------------------
@@ -214,6 +214,6 @@
// -------------------------------------------------------------------------
// $Log: auto_alloc.hpp,v $
-_NS_BOOST_END
+NS_BOOST_END
-#endif /* _BOOST_MEMORY_AUTO_ALLOC_HPP_ */
+#endif /* BOOST_MEMORY_AUTO_ALLOC_HPP */
Modified: sandbox/memory/boost/memory/basic.hpp
==============================================================================
--- sandbox/memory/boost/memory/basic.hpp (original)
+++ sandbox/memory/boost/memory/basic.hpp 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -9,8 +9,8 @@
//
// See http://www.boost.org/libs/memory/index.htm for documentation.
//
-#ifndef _BOOST_MEMORY_BASIC_HPP_
-#define _BOOST_MEMORY_BASIC_HPP_
+#ifndef BOOST_MEMORY_BASIC_HPP
+#define BOOST_MEMORY_BASIC_HPP
// -------------------------------------------------------------------------
@@ -42,9 +42,9 @@
// -------------------------------------------------------------------------
-#ifndef _NS_BOOST_BEGIN
-#define _NS_BOOST_BEGIN namespace boost {
-#define _NS_BOOST_END }
+#ifndef NS_BOOST_BEGIN
+#define NS_BOOST_BEGIN namespace boost {
+#define NS_BOOST_END }
#endif
// =========================================================================
@@ -83,10 +83,10 @@
// =========================================================================
// constructor_traits, destructor_traits
-_NS_BOOST_BEGIN
+NS_BOOST_BEGIN
-typedef void BOOST_MEMORY_CALL _FnDestructor(void* data);
-typedef _FnDestructor* destructor_t;
+typedef void BOOST_MEMORY_CALL BOOST_FnDestructor(void* data);
+typedef BOOST_FnDestructor* destructor_t;
template <class Type>
struct constructor_traits
@@ -162,13 +162,13 @@
destructor_traits<Type>::destructArrayN(array, count);
}
-_NS_BOOST_END
+NS_BOOST_END
// =========================================================================
// BOOST_NO_DESTRUCTOR
#define BOOST_NO_DESTRUCTOR(Type) \
-_NS_BOOST_BEGIN \
+NS_BOOST_BEGIN \
template <> \
struct destructor_traits< Type > \
{ \
@@ -197,13 +197,13 @@
return 0; \
} \
}; \
-_NS_BOOST_END
+NS_BOOST_END
// -------------------------------------------------------------------------
// BOOST_NO_CONSTRUCTOR
#define BOOST_NO_CONSTRUCTOR(Type) \
-_NS_BOOST_BEGIN \
+NS_BOOST_BEGIN \
template <> \
struct constructor_traits< Type > \
{ \
@@ -214,7 +214,7 @@
return array; \
} \
}; \
-_NS_BOOST_END
+NS_BOOST_END
// -------------------------------------------------------------------------
// C Standard Types Support
@@ -268,7 +268,7 @@
// =========================================================================
-_NS_BOOST_BEGIN
+NS_BOOST_BEGIN
inline void BOOST_MEMORY_CALL enableMemoryLeakCheck()
{
@@ -277,9 +277,9 @@
#endif
}
-_NS_BOOST_END
+NS_BOOST_END
// =========================================================================
// $Log: basic.hpp,v $
-#endif /* _BOOST_MEMORY_BASIC_HPP_ */
+#endif /* BOOST_MEMORY_BASIC_HPP */
Modified: sandbox/memory/boost/memory/gc_alloc.hpp
==============================================================================
--- sandbox/memory/boost/memory/gc_alloc.hpp (original)
+++ sandbox/memory/boost/memory/gc_alloc.hpp 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -9,16 +9,16 @@
//
// See http://www.boost.org/libs/memory/index.htm for documentation.
//
-#ifndef _BOOST_MEMORY_GC_ALLOC_HPP_
-#define _BOOST_MEMORY_GC_ALLOC_HPP_
+#ifndef BOOST_MEMORY_GC_ALLOC_HPP
+#define BOOST_MEMORY_GC_ALLOC_HPP
#pragma warning(disable:4786)
-#ifndef _BOOST_MEMORY_SCOPED_ALLOC_HPP_
+#ifndef BOOST_MEMORY_SCOPED_ALLOC_HPP
#include "scoped_alloc.hpp"
#endif
-#ifndef _BOOST_MEMORY_STL_QUEUE_HPP_
+#ifndef BOOST_MEMORY_STL_QUEUE_HPP
#include "stl/queue.hpp" // boost::priority_queue
#endif
@@ -26,7 +26,7 @@
#include <deque> // std::deque
#endif
-_NS_BOOST_BEGIN
+NS_BOOST_BEGIN
// -------------------------------------------------------------------------
// class gen_alloc
@@ -39,48 +39,48 @@
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
-template <class _Policy>
+template <class PolicyT>
class gen_alloc
{
private:
- typedef typename _Policy::allocator_type _Alloc;
- typedef typename _Policy::huge_gc_allocator _HugeGCAlloc;
- typedef size_t _HeaderSizeT;
+ typedef typename PolicyT::allocator_type AllocT;
+ typedef typename PolicyT::huge_gc_allocator HugeGCAllocT;
+ typedef size_t HeaderSizeT;
public:
- enum { MemBlockSize = _Policy::MemBlockSize };
+ enum { MemBlockSize = PolicyT::MemBlockSize };
enum { IsGCAllocator = TRUE };
- typedef _Alloc allocator_type;
- typedef _HugeGCAlloc huge_gc_allocator;
+ typedef AllocT allocator_type;
+ typedef HugeGCAllocT huge_gc_allocator;
#pragma pack(1)
private:
- enum _MemNodeType {
+ enum MemNodeType {
nodeFree = 0,
nodeAlloced = 1,
nodeAllocedWithDestructor = 3,
};
- struct _MemHeader
+ struct MemHeader
{
- _HeaderSizeT cbSize : 30;
- _HeaderSizeT blkType : 2;
+ HeaderSizeT cbSize : 30;
+ HeaderSizeT blkType : 2;
};
- struct _MemHeaderEx;
- struct _DestroyInfo
+ struct MemHeaderEx;
+ struct DestroyInfo
{
- _MemHeaderEx* pPrev;
+ MemHeaderEx* pPrev;
destructor_t fnDestroy;
};
- struct _MemHeaderEx // = _MemHeader + _DestroyInfo
+ struct MemHeaderEx // = MemHeader + DestroyInfo
{
- _HeaderSizeT cbSize : 30;
- _HeaderSizeT blkType : 2;
+ HeaderSizeT cbSize : 30;
+ HeaderSizeT blkType : 2;
- _MemHeaderEx* pPrev;
+ MemHeaderEx* pPrev;
destructor_t fnDestroy;
void BOOST_MEMORY_CALL destruct() {
@@ -91,22 +91,22 @@
}
};
- friend struct _MemHeaderEx;
+ friend struct MemHeaderEx;
- struct _FreeMemHeader
+ struct FreeMemHeader
{
- _HeaderSizeT cbSize;
- _HeaderSizeT BOOST_MEMORY_CALL getBlockType() const {
- return ((_MemHeader*)this)->blkType;
+ HeaderSizeT cbSize;
+ HeaderSizeT BOOST_MEMORY_CALL getBlockType() const {
+ return ((MemHeader*)this)->blkType;
}
char* BOOST_MEMORY_CALL getData() const {
return (char*)(this + 1);
}
};
- struct _MemBlock
+ struct MemBlock
{
- _MemBlock* pPrev;
+ MemBlock* pPrev;
char buffer[1];
class Enumerator
@@ -116,20 +116,20 @@
char* m_last;
public:
- Enumerator(_Alloc& alloc, _MemBlock* block) {
+ Enumerator(AllocT& alloc, MemBlock* block) {
m_start = block->buffer;
m_last = (char*)block + alloc.alloc_size(block);
}
- _MemHeader* BOOST_MEMORY_CALL first() const {
- return (_MemHeader*)m_start;
+ MemHeader* BOOST_MEMORY_CALL first() const {
+ return (MemHeader*)m_start;
}
- _MemHeader* BOOST_MEMORY_CALL current() const {
- return (_MemHeader*)m_start;
+ MemHeader* BOOST_MEMORY_CALL current() const {
+ return (MemHeader*)m_start;
}
- _MemHeader* BOOST_MEMORY_CALL next() {
+ MemHeader* BOOST_MEMORY_CALL next() {
BOOST_MEMORY_ASSERT(!done());
- m_start += sizeof(_MemHeader) + ((_MemHeader*)m_start)->cbSize;
- return (_MemHeader*)m_start;
+ m_start += sizeof(MemHeader) + ((MemHeader*)m_start)->cbSize;
+ return (MemHeader*)m_start;
}
bool BOOST_MEMORY_CALL done() const {
return m_start >= m_last;
@@ -138,83 +138,83 @@
};
#pragma pack()
- struct _Pred : std::binary_function<_FreeMemHeader*, _FreeMemHeader*, bool>
+ struct Pred : std::binary_function<FreeMemHeader*, FreeMemHeader*, bool>
{
- bool operator()(_FreeMemHeader* a, _FreeMemHeader* b) const {
+ bool operator()(FreeMemHeader* a, FreeMemHeader* b) const {
return a->cbSize < b->cbSize;
}
};
- typedef std::deque<_FreeMemHeader*> _Cont;
- typedef boost::priority_queue<_FreeMemHeader*, _Cont, _Pred> _PriorityQ;
+ typedef std::deque<FreeMemHeader*> Container;
+ typedef boost::priority_queue<FreeMemHeader*, Container, Pred> PriorityQ;
char* m_begin;
char* m_end;
- _Alloc m_alloc;
- _MemHeaderEx* m_destroyChain;
- _MemBlock* m_blockList;
- _PriorityQ m_freeList;
- _HugeGCAlloc m_hugeAlloc;
+ AllocT m_alloc;
+ MemHeaderEx* m_destroyChain;
+ MemBlock* m_blockList;
+ PriorityQ m_freeList;
+ HugeGCAllocT m_hugeAlloc;
size_t m_freeSize, m_GCLimitSize;
- static _FreeMemHeader _null;
+ static FreeMemHeader _null;
private:
enum { HeaderSize = sizeof(void*) };
enum { BlockSize = MemBlockSize - HeaderSize };
- enum { _AllocSizeBigDef = MAX(_Policy::AllocSizeBig, BlockSize/4) };
- enum { _AllocSizeHugeDef = MAX(_Policy::AllocSizeHuge, 64*1024) };
- enum { _GCLimitSizeDef = MAX(_Policy::GCLimitSizeDef, 64*1024) };
+ enum { _AllocSizeBigDef = MAX(PolicyT::AllocSizeBig, BlockSize/4) };
+ enum { _AllocSizeHugeDef = MAX(PolicyT::AllocSizeHuge, 64*1024) };
+ enum { _GCLimitSizeDef = MAX(PolicyT::GCLimitSizeDef, 64*1024) };
enum { AllocSizeBig = MIN(_AllocSizeBigDef, BlockSize/2) };
enum { AllocSizeHuge = MIN(_AllocSizeHugeDef, (1 << 29)) };
enum { GCLimitSizeDef = MIN(_GCLimitSizeDef, (1 << 29)) };
- enum { RecycleSizeMin = MAX(_Policy::RecycleSizeMin, 128) };
+ enum { RecycleSizeMin = MAX(PolicyT::RecycleSizeMin, 128) };
private:
const gen_alloc& operator=(const gen_alloc&);
- static bool BOOST_MEMORY_CALL _IsEqual(size_t cbAlloc, size_t cb)
+ static bool BOOST_MEMORY_CALL _isEqual(size_t cbAlloc, size_t cb)
{
return cbAlloc >= cb && cb + 64 > cbAlloc;
}
- static bool BOOST_MEMORY_CALL _IsValid(void* obj, size_t cb, destructor_t fn)
+ static bool BOOST_MEMORY_CALL _isValid(void* obj, size_t cb, destructor_t fn)
{
- _MemHeaderEx* node = (_MemHeaderEx*)obj - 1;
+ MemHeaderEx* node = (MemHeaderEx*)obj - 1;
BOOST_MEMORY_ASSERT(node->fnDestroy == fn);
- BOOST_MEMORY_ASSERT(_IsEqual(node->cbSize, cb + sizeof(_DestroyInfo)));
+ BOOST_MEMORY_ASSERT(_isEqual(node->cbSize, cb + sizeof(DestroyInfo)));
BOOST_MEMORY_ASSERT(node->blkType == nodeAllocedWithDestructor);
return node->fnDestroy == fn &&
- _IsEqual(node->cbSize, cb + sizeof(_DestroyInfo)) &&
+ _isEqual(node->cbSize, cb + sizeof(DestroyInfo)) &&
node->blkType == nodeAllocedWithDestructor;
}
- static bool BOOST_MEMORY_CALL _IsValid(void* obj, size_t cb, int fnZero)
+ static bool BOOST_MEMORY_CALL _isValid(void* obj, size_t cb, int fnZero)
{
- _MemHeader* node = (_MemHeader*)obj - 1;
- BOOST_MEMORY_ASSERT(_IsEqual(node->cbSize, cb));
+ MemHeader* node = (MemHeader*)obj - 1;
+ BOOST_MEMORY_ASSERT(_isEqual(node->cbSize, cb));
BOOST_MEMORY_ASSERT(node->blkType == nodeAlloced);
- return _IsEqual(node->cbSize, cb) && node->blkType == nodeAlloced;
+ return _isEqual(node->cbSize, cb) && node->blkType == nodeAlloced;
}
template <class Type>
- static bool BOOST_MEMORY_CALL _IsValid(Type* obj)
+ static bool BOOST_MEMORY_CALL _isValid(Type* obj)
{
- return _IsValid(obj, sizeof(Type), destructor_traits<Type>::destruct);
+ return _isValid(obj, sizeof(Type), destructor_traits<Type>::destruct);
}
template <class Type>
- static bool BOOST_MEMORY_CALL _IsValidArray(Type* array, size_t count)
+ static bool BOOST_MEMORY_CALL _isValidArray(Type* array, size_t count)
{
void* buf = destructor_traits<Type>::getArrayBuffer(array);
size_t cb = destructor_traits<Type>::getArrayAllocSize(count);
if (buf == array)
{
- return _IsValid(buf, cb, 0);
+ return _isValid(buf, cb, 0);
}
else
{
size_t count1 = destructor_traits<Type>::getArraySize(array);
BOOST_MEMORY_ASSERT(count1 == count);
- bool fValid = _IsValid(buf, cb, destructor_traits<Type>::destructArray);
+ bool fValid = _isValid(buf, cb, destructor_traits<Type>::destructArray);
return count1 == count && fValid;
}
}
@@ -225,7 +225,7 @@
// 0. Prepare
// 0.1. Commit current block:
- _CommitCurrentBlock();
+ _commitCurrentBlock();
m_begin = m_end = _null.getData();
// 0.2. Clear destroy chain
@@ -236,36 +236,36 @@
m_freeSize = 0;
// 1. Collect free nodes
- _MemBlock* pHeader = m_blockList;
+ MemBlock* pHeader = m_blockList;
while (pHeader)
{
- typename _MemBlock::Enumerator coll(m_alloc, pHeader);
+ typename MemBlock::Enumerator coll(m_alloc, pHeader);
pHeader = pHeader->pPrev;
for (;;)
{
if (coll.done())
break;
- _MemHeader* it = coll.current();
+ MemHeader* it = coll.current();
if (it->blkType == nodeFree)
{
// merge nodes marked with nodeFree
UINT cbFree = it->cbSize;
for (;;) {
- _MemHeader* it2 = coll.next();
+ MemHeader* it2 = coll.next();
if (coll.done() || it2->blkType != nodeFree)
break;
cbFree += it2->cbSize;
}
it->cbSize = cbFree;
if (cbFree >= RecycleSizeMin)
- m_freeList.push((_FreeMemHeader*)it);
+ m_freeList.push((FreeMemHeader*)it);
if (coll.done())
break;
it = coll.current();
}
if (it->blkType == nodeAllocedWithDestructor)
{
- _MemHeaderEx* itEx = (_MemHeaderEx*)it;
+ MemHeaderEx* itEx = (MemHeaderEx*)it;
itEx->pPrev = m_destroyChain;
m_destroyChain = itEx;
}
@@ -292,46 +292,46 @@
}
private:
- void BOOST_MEMORY_CALL _CommitCurrentBlock()
+ void BOOST_MEMORY_CALL _commitCurrentBlock()
{
- _FreeMemHeader* old = (_FreeMemHeader*)m_begin - 1;
+ FreeMemHeader* old = (FreeMemHeader*)m_begin - 1;
BOOST_MEMORY_ASSERT(old->getBlockType() == nodeFree);
old->cbSize = (m_end - m_begin);
}
- _MemHeader* BOOST_MEMORY_CALL _NewBlock(size_t cbBlock)
+ MemHeader* BOOST_MEMORY_CALL _newBlock(size_t cbBlock)
{
- _MemBlock* pBlock = (_MemBlock*)m_alloc.allocate(cbBlock);
+ MemBlock* pBlock = (MemBlock*)m_alloc.allocate(cbBlock);
pBlock->pPrev = m_blockList;
m_blockList = pBlock;
- _MemHeader* pNew = (_MemHeader*)pBlock->buffer;
+ MemHeader* pNew = (MemHeader*)pBlock->buffer;
pNew->blkType = nodeFree;
- pNew->cbSize = m_alloc.alloc_size(pBlock) - (sizeof(_MemHeader) + HeaderSize);
+ pNew->cbSize = m_alloc.alloc_size(pBlock) - (sizeof(MemHeader) + HeaderSize);
return pNew;
}
- void BOOST_MEMORY_CALL _Init()
+ void BOOST_MEMORY_CALL _init()
{
m_blockList = NULL;
m_destroyChain = NULL;
m_freeSize = 0;
m_GCLimitSize = GCLimitSizeDef;
- _MemHeader* pNew = _NewBlock(MemBlockSize);
+ MemHeader* pNew = _newBlock(MemBlockSize);
m_begin = (char*)(pNew + 1);
m_end = m_begin + pNew->cbSize;
}
public:
gen_alloc() {
- _Init();
+ _init();
}
- explicit gen_alloc(_Alloc alloc) : m_alloc(alloc) {
- _Init();
+ explicit gen_alloc(AllocT alloc) : m_alloc(alloc) {
+ _init();
}
explicit gen_alloc(gen_alloc& owner) : m_alloc(owner.m_alloc) {
- _Init();
+ _init();
}
~gen_alloc()
@@ -357,14 +357,14 @@
m_hugeAlloc.clear();
while (m_destroyChain)
{
- _MemHeaderEx* curr = m_destroyChain;
+ MemHeaderEx* curr = m_destroyChain;
m_destroyChain = m_destroyChain->pPrev;
curr->destruct();
}
- _MemBlock* pHeader = m_blockList;
+ MemBlock* pHeader = m_blockList;
while (pHeader)
{
- _MemBlock* curr = pHeader;
+ MemBlock* curr = pHeader;
pHeader = pHeader->pPrev;
m_alloc.deallocate(curr);
}
@@ -376,10 +376,10 @@
void* BOOST_MEMORY_CALL allocate(size_t cbData)
{
- const size_t cb = cbData + sizeof(_MemHeader);
+ const size_t cb = cbData + sizeof(MemHeader);
if ((size_t)(m_end - m_begin) < cb)
{
- _MemHeader* pNew;
+ MemHeader* pNew;
if (cb >= AllocSizeBig)
{
if (cbData >= AllocSizeHuge)
@@ -387,32 +387,32 @@
if (cb >= BlockSize)
{
- pNew = _NewBlock(cb + HeaderSize);
+ pNew = _newBlock(cb + HeaderSize);
pNew->blkType = nodeAlloced;
return pNew + 1;
}
- pNew = _NewBlock(MemBlockSize);
+ pNew = _newBlock(MemBlockSize);
}
else
{
try_gc();
- _FreeMemHeader* p;
+ FreeMemHeader* p;
if (m_freeList.empty() || (p = m_freeList.top())->cbSize < cb) {
- pNew = _NewBlock(MemBlockSize);
+ pNew = _newBlock(MemBlockSize);
}
else {
- pNew = (_MemHeader*)p;
+ pNew = (MemHeader*)p;
m_freeList.pop();
}
}
- _CommitCurrentBlock();
+ _commitCurrentBlock();
m_begin = (char*)(pNew + 1);
m_end = m_begin + pNew->cbSize;
}
BOOST_MEMORY_ASSERT(m_end - m_begin >= cb);
- _MemHeader* pAlloc = (_MemHeader*)(m_end -= cb);
+ MemHeader* pAlloc = (MemHeader*)(m_end -= cb);
pAlloc->blkType = nodeAlloced;
pAlloc->cbSize = cbData;
return pAlloc + 1;
@@ -423,10 +423,10 @@
if (cb >= AllocSizeHuge)
return m_hugeAlloc.allocate(cb, fn);
- _DestroyInfo* pNode = (_DestroyInfo*)allocate(sizeof(_DestroyInfo) + cb);
+ DestroyInfo* pNode = (DestroyInfo*)allocate(sizeof(DestroyInfo) + cb);
pNode->fnDestroy = fn;
pNode->pPrev = m_destroyChain;
- m_destroyChain = (_MemHeaderEx*)((char*)pNode - sizeof(_MemHeader));
+ m_destroyChain = (MemHeaderEx*)((char*)pNode - sizeof(MemHeader));
m_destroyChain->blkType = nodeAllocedWithDestructor;
return pNode + 1;
}
@@ -444,61 +444,61 @@
}
else
{
- _MemHeader* p = (_MemHeader*)pData - 1;
+ MemHeader* p = (MemHeader*)pData - 1;
BOOST_MEMORY_ASSERT(p->cbSize == cbData);
BOOST_MEMORY_ASSERT(p->blkType == nodeAlloced);
p->blkType = nodeFree;
- m_freeSize += cbData + sizeof(_MemHeader);
+ m_freeSize += cbData + sizeof(MemHeader);
}
}
private:
template <class Type>
- void BOOST_MEMORY_CALL _Destroy(Type* obj, destructor_t)
+ void BOOST_MEMORY_CALL _destroy(Type* obj, destructor_t)
{
obj->~Type();
- _MemHeaderEx* p = (_MemHeaderEx*)obj - 1;
+ MemHeaderEx* p = (MemHeaderEx*)obj - 1;
p->blkType = nodeFree;
- m_freeSize += sizeof(Type) + sizeof(_MemHeaderEx);
+ m_freeSize += sizeof(Type) + sizeof(MemHeaderEx);
}
template <class Type>
- void BOOST_MEMORY_CALL _Destroy(Type* obj, int)
+ void BOOST_MEMORY_CALL _destroy(Type* obj, int)
{
- _MemHeader* p = (_MemHeader*)obj - 1;
+ MemHeader* p = (MemHeader*)obj - 1;
p->blkType = nodeFree;
- m_freeSize += sizeof(Type) + sizeof(_MemHeader);
+ m_freeSize += sizeof(Type) + sizeof(MemHeader);
}
template <class Type>
- void BOOST_MEMORY_CALL _DestroyArray(Type* array, size_t count, destructor_t)
+ void BOOST_MEMORY_CALL _destroyArray(Type* array, size_t count, destructor_t)
{
- typedef destructor_traits<Type> _Traits;
+ typedef destructor_traits<Type> Traits;
- _Traits::destructArrayN(array, count);
- void* pData = _Traits::getArrayBuffer(array);
- _MemHeaderEx* p = (_MemHeaderEx*)pData - 1;
+ Traits::destructArrayN(array, count);
+ void* pData = Traits::getArrayBuffer(array);
+ MemHeaderEx* p = (MemHeaderEx*)pData - 1;
p->blkType = nodeFree;
- m_freeSize += _Traits::getArrayAllocSize(count) + sizeof(_MemHeaderEx);
+ m_freeSize += Traits::getArrayAllocSize(count) + sizeof(MemHeaderEx);
}
template <class Type>
- void BOOST_MEMORY_CALL _DestroyArray(Type* array, size_t count, int)
+ void BOOST_MEMORY_CALL _destroyArray(Type* array, size_t count, int)
{
- _MemHeader* p = (_MemHeader*)array - 1;
+ MemHeader* p = (MemHeader*)array - 1;
p->blkType = nodeFree;
- m_freeSize += sizeof(Type) * count + sizeof(_MemHeader);
+ m_freeSize += sizeof(Type) * count + sizeof(MemHeader);
}
public:
template <class Type>
void BOOST_MEMORY_CALL destroy(Type* obj)
{
- BOOST_MEMORY_ASSERT( _IsValid(obj) );
+ BOOST_MEMORY_ASSERT( _isValid(obj) );
BOOST_MEMORY_ASSERT( sizeof(Type) < AllocSizeHuge );
- _Destroy(obj, destructor_traits<Type>::destruct);
+ _destroy(obj, destructor_traits<Type>::destruct);
}
template <class Type>
@@ -515,7 +515,7 @@
template <class Type>
void BOOST_MEMORY_CALL destroyArray(Type* array, size_t count)
{
- BOOST_MEMORY_ASSERT( _IsValidArray(array, count) );
+ BOOST_MEMORY_ASSERT( _isValidArray(array, count) );
size_t cb = destructor_traits<Type>::getArrayAllocSize(count);
if (cb >= AllocSizeHuge)
@@ -524,15 +524,15 @@
}
else
{
- _DestroyArray(array, count, destructor_traits<Type>::destruct);
+ _destroyArray(array, count, destructor_traits<Type>::destruct);
}
}
- _BOOST_FAKE_DBG_ALLOCATE();
+ BOOST_FAKE_DBG_ALLOCATE_();
};
-template <class _Policy>
-typename gen_alloc<_Policy>::_FreeMemHeader gen_alloc<_Policy>::_null;
+template <class PolicyT>
+typename gen_alloc<PolicyT>::FreeMemHeader gen_alloc<PolicyT>::_null;
// -------------------------------------------------------------------------
// class gc_alloc
@@ -542,6 +542,6 @@
// -------------------------------------------------------------------------
// $Log: gc_alloc.hpp,v $
-_NS_BOOST_END
+NS_BOOST_END
-#endif /* _BOOST_MEMORY_GC_ALLOC_HPP_ */
+#endif /* BOOST_MEMORY_GC_ALLOC_HPP */
Modified: sandbox/memory/boost/memory/linklib.hpp
==============================================================================
--- sandbox/memory/boost/memory/linklib.hpp (original)
+++ sandbox/memory/boost/memory/linklib.hpp 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -9,13 +9,13 @@
//
// See http://www.boost.org/libs/memory/index.htm for documentation.
//
-#ifndef _BOOST_MEMORY_LINKLIB_HPP_
-#define _BOOST_MEMORY_LINKLIB_HPP_
+#ifndef BOOST_MEMORY_LINKLIB_HPP
+#define BOOST_MEMORY_LINKLIB_HPP
// -------------------------------------------------------------------------
-#if !defined(_Linked_boost_memory)
-#define _Linked_boost_memory
+#if !defined(BOOST_Linked_boost_memory)
+#define BOOST_Linked_boost_memory
#if defined(_MSC_VER)
# pragma comment(lib, "boost-memory")
#endif
@@ -24,4 +24,4 @@
// -------------------------------------------------------------------------
// $Log: linklib.hpp,v $
-#endif /* _BOOST_MEMORY_LINKLIB_HPP_ */
+#endif /* BOOST_MEMORY_LINKLIB_HPP */
Modified: sandbox/memory/boost/memory/policy.hpp
==============================================================================
--- sandbox/memory/boost/memory/policy.hpp (original)
+++ sandbox/memory/boost/memory/policy.hpp 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -9,36 +9,36 @@
//
// See http://www.boost.org/libs/memory/index.htm for documentation.
//
-#ifndef _BOOST_MEMORY_POLICY_HPP_
-#define _BOOST_MEMORY_POLICY_HPP_
+#ifndef BOOST_MEMORY_POLICY_HPP
+#define BOOST_MEMORY_POLICY_HPP
-#ifndef _BOOST_MEMORY_SYSTEM_ALLOC_HPP_
+#ifndef BOOST_MEMORY_SYSTEM_ALLOC_HPP
#include "system_alloc.hpp"
#endif
-_NS_BOOST_BEGIN
+NS_BOOST_BEGIN
// -------------------------------------------------------------------------
// class simple_gc_alloc
-template <class _SysAlloc>
+template <class SysAllocT>
class simple_gc_alloc
{
#pragma pack(1)
private:
- struct _DestroyNode
+ struct DestroyNode
{
- _DestroyNode* pPrev;
+ DestroyNode* pPrev;
destructor_t fnDestroy;
};
- struct _MemBlock
+ struct MemBlock
{
- _MemBlock* pPrev;
+ MemBlock* pPrev;
};
#pragma pack()
- _MemBlock* m_memChain;
- _DestroyNode* m_destroyChain;
+ MemBlock* m_memChain;
+ DestroyNode* m_destroyChain;
public:
simple_gc_alloc()
@@ -56,15 +56,15 @@
{
while (m_destroyChain)
{
- _DestroyNode* curr = m_destroyChain;
+ DestroyNode* curr = m_destroyChain;
m_destroyChain = m_destroyChain->pPrev;
curr->fnDestroy(curr + 1);
}
while (m_memChain)
{
- _MemBlock* curr = m_memChain;
+ MemBlock* curr = m_memChain;
m_memChain = m_memChain->pPrev;
- _SysAlloc::deallocate(curr);
+ SysAllocT::deallocate(curr);
}
}
@@ -89,7 +89,7 @@
void* BOOST_MEMORY_CALL allocate(size_t cb)
{
- _MemBlock* p = (_MemBlock*)_SysAlloc::allocate(cb + sizeof(_MemBlock));
+ MemBlock* p = (MemBlock*)SysAllocT::allocate(cb + sizeof(MemBlock));
p->pPrev = m_memChain;
m_memChain = p;
return p + 1;
@@ -97,7 +97,7 @@
void* BOOST_MEMORY_CALL allocate(size_t cb, destructor_t fn)
{
- _DestroyNode* pNode = (_DestroyNode*)allocate(cb + sizeof(_DestroyNode));
+ DestroyNode* pNode = (DestroyNode*)allocate(cb + sizeof(DestroyNode));
pNode->fnDestroy = fn;
pNode->pPrev = m_destroyChain;
m_destroyChain = pNode;
@@ -141,6 +141,6 @@
// -------------------------------------------------------------------------
// $Log: policy.hpp,v $
-_NS_BOOST_END
+NS_BOOST_END
-#endif /* _BOOST_MEMORY_POLICY_HPP_ */
+#endif /* BOOST_MEMORY_POLICY_HPP */
Modified: sandbox/memory/boost/memory/scoped_alloc.hpp
==============================================================================
--- sandbox/memory/boost/memory/scoped_alloc.hpp (original)
+++ sandbox/memory/boost/memory/scoped_alloc.hpp 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -9,18 +9,18 @@
//
// See http://www.boost.org/libs/memory/index.htm for documentation.
//
-#ifndef _BOOST_MEMORY_SCOPED_ALLOC_HPP_
-#define _BOOST_MEMORY_SCOPED_ALLOC_HPP_
+#ifndef BOOST_MEMORY_SCOPED_ALLOC_HPP
+#define BOOST_MEMORY_SCOPED_ALLOC_HPP
-#ifndef _BOOST_MEMORY_BASIC_HPP_
+#ifndef BOOST_MEMORY_BASIC_HPP
#include "basic.hpp"
#endif
-#ifndef _BOOST_MEMORY_AUTO_ALLOC_HPP_
+#ifndef BOOST_MEMORY_AUTO_ALLOC_HPP
#include "auto_alloc.hpp"
#endif
-#ifndef _BOOST_MEMORY_THREAD_TLS_HPP_
+#ifndef BOOST_MEMORY_THREAD_TLS_HPP
#include "thread/tls.hpp"
#endif
@@ -28,7 +28,7 @@
#include <climits> // INT_MAX
#endif
-_NS_BOOST_BEGIN
+NS_BOOST_BEGIN
// -------------------------------------------------------------------------
// class proxy_alloc
@@ -53,20 +53,20 @@
// -------------------------------------------------------------------------
// class block_pool
-template <class _Policy>
+template <class PolicyT>
class block_pool_imp
{
private:
- typedef typename _Policy::allocator_type _Alloc;
- enum { m_cbBlock = _Policy::MemBlockSize };
+ typedef typename PolicyT::allocator_type AllocT;
+ enum { m_cbBlock = PolicyT::MemBlockSize };
#pragma pack(1)
- struct _Block {
- _Block* next;
+ struct Block {
+ Block* next;
};
#pragma pack()
- _Block* m_freeList;
+ Block* m_freeList;
int m_nFree;
const int m_nFreeLimit;
@@ -92,28 +92,28 @@
BOOST_MEMORY_ASSERT(cb >= (size_t)m_cbBlock);
if (cb > (size_t)m_cbBlock)
- return _Alloc::allocate(cb);
+ return AllocT::allocate(cb);
else
{
if (m_freeList)
{
- BOOST_MEMORY_ASSERT(_Alloc::alloc_size(m_freeList) >= cb);
- _Block* blk = m_freeList;
+ BOOST_MEMORY_ASSERT(AllocT::alloc_size(m_freeList) >= cb);
+ Block* blk = m_freeList;
m_freeList = blk->next;
--m_nFree;
return blk;
}
- return _Alloc::allocate(m_cbBlock);
+ return AllocT::allocate(m_cbBlock);
}
}
void BOOST_MEMORY_CALL deallocate(void* p)
{
if (m_nFree >= m_nFreeLimit) {
- _Alloc::deallocate(p);
+ AllocT::deallocate(p);
}
else {
- _Block* blk = (_Block*)p;
+ Block* blk = (Block*)p;
blk->next = m_freeList;
m_freeList = blk;
++m_nFree;
@@ -122,16 +122,16 @@
static size_t BOOST_MEMORY_CALL alloc_size(void* p)
{
- return _Alloc::alloc_size(p);
+ return AllocT::alloc_size(p);
}
void BOOST_MEMORY_CALL clear()
{
while (m_freeList)
{
- _Block* blk = m_freeList;
+ Block* blk = m_freeList;
m_freeList = blk->next;
- _Alloc::deallocate(blk);
+ AllocT::deallocate(blk);
}
m_nFree = 0;
}
@@ -146,7 +146,7 @@
STDAPI_(tls_block_pool_t*) _boost_TlsBlockPool();
-template <class _Unused>
+template <class Unused>
class tls_block_pool_imp
{
private:
@@ -166,8 +166,8 @@
}
};
-template <class _Unused>
-tls_block_pool_t* tls_block_pool_imp<_Unused>::_tls_blockPool = _boost_TlsBlockPool();
+template <class Unused>
+tls_block_pool_t* tls_block_pool_imp<Unused>::_tls_blockPool = _boost_TlsBlockPool();
typedef tls_block_pool_imp<int> tls_block_pool;
@@ -191,6 +191,6 @@
// -------------------------------------------------------------------------
// $Log: $
-_NS_BOOST_END
+NS_BOOST_END
-#endif /* _BOOST_MEMORY_SCOPED_ALLOC_HPP_ */
+#endif /* BOOST_MEMORY_SCOPED_ALLOC_HPP */
Modified: sandbox/memory/boost/memory/stl/queue.hpp
==============================================================================
--- sandbox/memory/boost/memory/stl/queue.hpp (original)
+++ sandbox/memory/boost/memory/stl/queue.hpp 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -9,8 +9,8 @@
//
// See http://www.boost.org/libs/memory/index.htm for documentation.
//
-#ifndef _BOOST_MEMORY_STL_QUEUE_HPP_
-#define _BOOST_MEMORY_STL_QUEUE_HPP_
+#ifndef BOOST_MEMORY_STL_QUEUE_HPP
+#define BOOST_MEMORY_STL_QUEUE_HPP
#if !defined(_DEQUE_) && !defined(_DEQUE)
#include <deque> // std::deque
@@ -24,63 +24,63 @@
#include <algorithm> // std::make_heap, etc
#endif
-#ifndef _NS_BOOST_BEGIN
-#define _NS_BOOST_BEGIN namespace boost {
-#define _NS_BOOST_END }
+#ifndef NS_BOOST_BEGIN
+#define NS_BOOST_BEGIN namespace boost {
+#define NS_BOOST_END }
#endif
-_NS_BOOST_BEGIN
+NS_BOOST_BEGIN
// -------------------------------------------------------------------------
-template <class _Tp,
- class _Sequence = std::deque<_Tp>,
- class _Pred = std::less<_Tp> >
+template <class Type,
+ class Sequence = std::deque<Type>,
+ class Pred = std::less<Type> >
class priority_queue
{
public:
- typedef typename _Sequence::value_type value_type;
- typedef typename _Sequence::size_type size_type;
- typedef _Sequence container_type;
+ typedef typename Sequence::value_type value_type;
+ typedef typename Sequence::size_type size_type;
+ typedef Sequence container_type;
- typedef typename _Sequence::reference reference;
- typedef typename _Sequence::const_reference const_reference;
+ typedef typename Sequence::reference reference;
+ typedef typename Sequence::const_reference const_reference;
protected:
- _Sequence m_coll;
- _Pred m_pred;
+ Sequence m_coll;
+ Pred m_pred;
public:
priority_queue() {}
- explicit priority_queue(const _Pred& __x) : m_coll(), m_pred(__x) {}
- priority_queue(const _Pred& __x, const _Sequence& __s)
- : m_coll(__s), m_pred(__x)
+ explicit priority_queue(const Pred& x) : m_coll(), m_pred(x) {}
+ priority_queue(const Pred& x, const Sequence& s)
+ : m_coll(s), m_pred(x)
{ std::make_heap(m_coll.begin(), m_coll.end(), m_pred); }
- template <class _InputIterator>
- priority_queue(_InputIterator __first, _InputIterator __last)
- : m_coll(__first, __last) { std::make_heap(m_coll.begin(), m_coll.end(), m_pred); }
-
- template <class _InputIterator>
- priority_queue(_InputIterator __first,
- _InputIterator __last, const _Pred& __x)
- : m_coll(__first, __last), m_pred(__x)
+ template <class InputIterator>
+ priority_queue(InputIterator first, InputIterator last)
+ : m_coll(first, last) { std::make_heap(m_coll.begin(), m_coll.end(), m_pred); }
+
+ template <class InputIterator>
+ priority_queue(InputIterator first,
+ InputIterator last, const Pred& x)
+ : m_coll(first, last), m_pred(x)
{ std::make_heap(m_coll.begin(), m_coll.end(), m_pred); }
- template <class _InputIterator>
- priority_queue(_InputIterator __first, _InputIterator __last,
- const _Pred& __x, const _Sequence& __s)
- : m_coll(__s), m_pred(__x)
+ template <class InputIterator>
+ priority_queue(InputIterator first, InputIterator last,
+ const Pred& x, const Sequence& s)
+ : m_coll(s), m_pred(x)
{
- m_coll.insert(m_coll.end(), __first, __last);
+ m_coll.insert(m_coll.end(), first, last);
std::make_heap(m_coll.begin(), m_coll.end(), m_pred);
}
bool empty() const { return m_coll.empty(); }
size_type size() const { return m_coll.size(); }
const_reference top() const { return m_coll.front(); }
- void push(const value_type& __x) {
- m_coll.push_back(__x);
+ void push(const value_type& x) {
+ m_coll.push_back(x);
std::push_heap(m_coll.begin(), m_coll.end(), m_pred);
}
void pop() {
@@ -99,6 +99,6 @@
// -------------------------------------------------------------------------
// $Log: $
-_NS_BOOST_END
+NS_BOOST_END
-#endif /* _BOOST_MEMORY_STL_QUEUE_HPP_ */
+#endif /* BOOST_MEMORY_STL_QUEUE_HPP */
Modified: sandbox/memory/boost/memory/system_alloc.hpp
==============================================================================
--- sandbox/memory/boost/memory/system_alloc.hpp (original)
+++ sandbox/memory/boost/memory/system_alloc.hpp 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -9,14 +9,14 @@
//
// See http://www.boost.org/libs/memory/index.htm for documentation.
//
-#ifndef _BOOST_MEMORY_SYSTEM_ALLOC_HPP_
-#define _BOOST_MEMORY_SYSTEM_ALLOC_HPP_
+#ifndef BOOST_MEMORY_SYSTEM_ALLOC_HPP
+#define BOOST_MEMORY_SYSTEM_ALLOC_HPP
-#ifndef _BOOST_MEMORY_BASIC_HPP_
+#ifndef BOOST_MEMORY_BASIC_HPP
#include "basic.hpp"
#endif
-#ifndef _BOOST_MEMORY_THREADMODEL_HPP_
+#ifndef BOOST_MEMORY_THREADMODEL_HPP
#include "threadmodel.hpp"
#endif
@@ -28,14 +28,14 @@
#include <cstdlib> // malloc, free
#endif
-_NS_BOOST_BEGIN
+NS_BOOST_BEGIN
// -------------------------------------------------------------------------
-// _BOOST_FAKE_DBG_ALLOCATE
+// BOOST_FAKE_DBG_ALLOCATE_
#if defined(_DEBUG)
-#define _BOOST_FAKE_DBG_ALLOCATE() \
+#define BOOST_FAKE_DBG_ALLOCATE_() \
void* BOOST_MEMORY_CALL allocate(size_t cb, LPCSTR szFile, int nLine) \
{ return allocate(cb); } \
void* BOOST_MEMORY_CALL allocate(size_t cb, destructor_t fn, LPCSTR szFile, int nLine) \
@@ -50,7 +50,7 @@
#else
-#define _BOOST_FAKE_DBG_ALLOCATE()
+#define BOOST_FAKE_DBG_ALLOCATE_()
#endif
@@ -122,7 +122,7 @@
return constructor_traits<Type>::constructArray(array, count);
}
#else
- _BOOST_FAKE_DBG_ALLOCATE()
+ BOOST_FAKE_DBG_ALLOCATE_()
#endif
};
@@ -134,6 +134,6 @@
// -------------------------------------------------------------------------
// $Log: $
-_NS_BOOST_END
+NS_BOOST_END
-#endif /* _BOOST_MEMORY_SYSTEM_ALLOC_HPP_ */
+#endif /* BOOST_MEMORY_SYSTEM_ALLOC_HPP */
Modified: sandbox/memory/boost/memory/thread/tls.hpp
==============================================================================
--- sandbox/memory/boost/memory/thread/tls.hpp (original)
+++ sandbox/memory/boost/memory/thread/tls.hpp 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -9,14 +9,14 @@
//
// See http://www.boost.org/libs/memory/index.htm for documentation.
//
-#ifndef _BOOST_MEMORY_THREAD_TLS_HPP_
-#define _BOOST_MEMORY_THREAD_TLS_HPP_
+#ifndef BOOST_MEMORY_THREAD_TLS_HPP
+#define BOOST_MEMORY_THREAD_TLS_HPP
-#ifndef _BOOST_MEMORY_BASIC_HPP_
+#ifndef BOOST_MEMORY_BASIC_HPP
#include "../basic.hpp"
#endif
-#ifndef _BOOST_MEMORY_THREADMODEL_HPP_
+#ifndef BOOST_MEMORY_THREADMODEL_HPP
#include "../threadmodel.hpp"
#endif
@@ -25,7 +25,7 @@
#if defined(_WIN32)
-_NS_BOOST_BEGIN
+NS_BOOST_BEGIN
typedef DWORD TLSINDEX;
@@ -56,7 +56,7 @@
}
};
-_NS_BOOST_END
+NS_BOOST_END
#endif // defined(_WIN32)
@@ -69,7 +69,7 @@
#include <pthread.h>
#endif
-_NS_BOOST_BEGIN
+NS_BOOST_BEGIN
class pthread_tls_key
{
@@ -98,14 +98,14 @@
}
};
-_NS_BOOST_END
+NS_BOOST_END
#endif // !defined(_WIN32)
// -------------------------------------------------------------------------
// class tls_key
-_NS_BOOST_BEGIN
+NS_BOOST_BEGIN
#if defined(_WIN32)
@@ -117,12 +117,12 @@
#endif
-_NS_BOOST_END
+NS_BOOST_END
// -------------------------------------------------------------------------
// class tls_ptr
-_NS_BOOST_BEGIN
+NS_BOOST_BEGIN
template <class Type>
class tls_ptr
@@ -163,12 +163,12 @@
}
};
-_NS_BOOST_END
+NS_BOOST_END
// -------------------------------------------------------------------------
// class tls_object
-_NS_BOOST_BEGIN
+NS_BOOST_BEGIN
template <class Type>
class tls_factory
@@ -238,9 +238,9 @@
}
};
-_NS_BOOST_END
+NS_BOOST_END
// -------------------------------------------------------------------------
// $Log: $
-#endif /* _BOOST_MEMORY_THREAD_TLS_HPP_ */
+#endif /* BOOST_MEMORY_THREAD_TLS_HPP */
Modified: sandbox/memory/boost/memory/threadmodel.hpp
==============================================================================
--- sandbox/memory/boost/memory/threadmodel.hpp (original)
+++ sandbox/memory/boost/memory/threadmodel.hpp 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -9,20 +9,20 @@
//
// See http://www.boost.org/libs/memory/index.htm for documentation.
//
-#ifndef _BOOST_MEMORY_THREADMODEL_HPP_
-#define _BOOST_MEMORY_THREADMODEL_HPP_
+#ifndef BOOST_MEMORY_THREADMODEL_HPP
+#define BOOST_MEMORY_THREADMODEL_HPP
// -------------------------------------------------------------------------
-#ifndef _BOOST_MEMORY_THREADMODEL_SINGLE_THREAD_H_
+#ifndef BOOST_MEMORY_THREADMODEL_SINGLE_THREAD_H
#include "threadmodel/single_thread.hpp"
#endif
-#ifndef _BOOST_MEMORY_THREADMODEL_MULTI_THREAD_H_
+#ifndef BOOST_MEMORY_THREADMODEL_MULTI_THREAD_H
#include "threadmodel/multi_thread.hpp"
#endif
-_NS_BOOST_BEGIN
+NS_BOOST_BEGIN
// -------------------------------------------------------------------------
// class auto_lock
@@ -90,6 +90,6 @@
// -------------------------------------------------------------------------
// $Log: $
-_NS_BOOST_END
+NS_BOOST_END
-#endif /* _BOOST_MEMORY_THREADMODEL_HPP_ */
+#endif /* BOOST_MEMORY_THREADMODEL_HPP */
Modified: sandbox/memory/boost/memory/threadmodel/multi_thread.hpp
==============================================================================
--- sandbox/memory/boost/memory/threadmodel/multi_thread.hpp (original)
+++ sandbox/memory/boost/memory/threadmodel/multi_thread.hpp 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -9,18 +9,18 @@
//
// See http://www.boost.org/libs/memory/index.htm for documentation.
//
-#ifndef _BOOST_MEMORY_THREADMODEL_MULTI_THREAD_H_
-#define _BOOST_MEMORY_THREADMODEL_MULTI_THREAD_H_
+#ifndef BOOST_MEMORY_THREADMODEL_MULTI_THREAD_H
+#define BOOST_MEMORY_THREADMODEL_MULTI_THREAD_H
-#ifndef _BOOST_MEMORY_BASIC_HPP_
+#ifndef BOOST_MEMORY_BASIC_HPP
#include "../basic.hpp"
#endif
-#ifndef _BOOST_MEMORY_WINAPI_WINBASE_H_
+#ifndef BOOST_MEMORY_WINAPI_WINBASE_H
#include "../winapi/winbase.h"
#endif
-_NS_BOOST_BEGIN
+NS_BOOST_BEGIN
// -------------------------------------------------------------------------
// class refcount_mt
@@ -92,6 +92,6 @@
// -------------------------------------------------------------------------
// $Log: $
-_NS_BOOST_END
+NS_BOOST_END
-#endif /* _BOOST_MEMORY_THREADMODEL_MULTI_THREAD_H_ */
+#endif /* BOOST_MEMORY_THREADMODEL_MULTI_THREAD_H */
Modified: sandbox/memory/boost/memory/threadmodel/single_thread.hpp
==============================================================================
--- sandbox/memory/boost/memory/threadmodel/single_thread.hpp (original)
+++ sandbox/memory/boost/memory/threadmodel/single_thread.hpp 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -9,14 +9,14 @@
//
// See http://www.boost.org/libs/memory/index.htm for documentation.
//
-#ifndef _BOOST_MEMORY_THREADMODEL_SINGLE_THREAD_H_
-#define _BOOST_MEMORY_THREADMODEL_SINGLE_THREAD_H_
+#ifndef BOOST_MEMORY_THREADMODEL_SINGLE_THREAD_H
+#define BOOST_MEMORY_THREADMODEL_SINGLE_THREAD_H
-#ifndef _BOOST_MEMORY_BASIC_HPP_
+#ifndef BOOST_MEMORY_BASIC_HPP
#include "../basic.hpp"
#endif
-_NS_BOOST_BEGIN
+NS_BOOST_BEGIN
// -------------------------------------------------------------------------
// struct refcount_st
@@ -56,6 +56,6 @@
// -------------------------------------------------------------------------
// $Log: $
-_NS_BOOST_END
+NS_BOOST_END
-#endif /* _BOOST_MEMORY_THREADMODEL_SINGLE_THREAD_H_ */
+#endif /* BOOST_MEMORY_THREADMODEL_SINGLE_THREAD_H */
Modified: sandbox/memory/boost/memory/winapi/posix/pthread.hpp
==============================================================================
--- sandbox/memory/boost/memory/winapi/posix/pthread.hpp (original)
+++ sandbox/memory/boost/memory/winapi/posix/pthread.hpp 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -9,10 +9,10 @@
//
// See http://www.boost.org/libs/memory/index.htm for documentation.
//
-#ifndef _BOOST_MEMORY_WINAPI_POSIX_PTHREAD_HPP_
-#define _BOOST_MEMORY_WINAPI_POSIX_PTHREAD_HPP_
+#ifndef BOOST_MEMORY_WINAPI_POSIX_PTHREAD_HPP
+#define BOOST_MEMORY_WINAPI_POSIX_PTHREAD_HPP
-#ifndef _BOOST_MEMORY_WINAPI_WINDEF_H_
+#ifndef BOOST_MEMORY_WINAPI_WINDEF_H
#include "../windef.h"
#endif
@@ -108,4 +108,4 @@
// -------------------------------------------------------------------------
// $Log: $
-#endif /* _BOOST_MEMORY_WINAPI_POSIX_PTHREAD_HPP_ */
+#endif /* BOOST_MEMORY_WINAPI_POSIX_PTHREAD_HPP */
Modified: sandbox/memory/boost/memory/winapi/winbase.h
==============================================================================
--- sandbox/memory/boost/memory/winapi/winbase.h (original)
+++ sandbox/memory/boost/memory/winapi/winbase.h 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -9,8 +9,8 @@
//
// See http://www.boost.org/libs/memory/index.htm for documentation.
//
-#ifndef _BOOST_MEMORY_WINAPI_WINBASE_H_
-#define _BOOST_MEMORY_WINAPI_WINBASE_H_
+#ifndef BOOST_MEMORY_WINAPI_WINBASE_H
+#define BOOST_MEMORY_WINAPI_WINBASE_H
#if defined(_WIN32)
@@ -26,11 +26,11 @@
#define BOOST_NO_WINSDK
-#ifndef _BOOST_MEMORY_WINAPI_WTYPES_H_
+#ifndef BOOST_MEMORY_WINAPI_WTYPES_H
#include "wtypes.h"
#endif
-#ifndef _BOOST_MEMORY_WINAPI_POSIX_PTHREAD_HPP_
+#ifndef BOOST_MEMORY_WINAPI_POSIX_PTHREAD_HPP
#include "posix/pthread.hpp"
#endif
@@ -39,4 +39,4 @@
// -------------------------------------------------------------------------
// $Log: $
-#endif /* _BOOST_MEMORY_WINAPI_WINBASE_H_ */
+#endif /* BOOST_MEMORY_WINAPI_WINBASE_H */
Modified: sandbox/memory/boost/memory/winapi/windef.h
==============================================================================
--- sandbox/memory/boost/memory/winapi/windef.h (original)
+++ sandbox/memory/boost/memory/winapi/windef.h 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -9,8 +9,8 @@
//
// See http://www.boost.org/libs/memory/index.htm for documentation.
//
-#ifndef _BOOST_MEMORY_WINAPI_WINDEF_H_
-#define _BOOST_MEMORY_WINAPI_WINDEF_H_
+#ifndef BOOST_MEMORY_WINAPI_WINDEF_H
+#define BOOST_MEMORY_WINAPI_WINDEF_H
#ifndef BOOST_NO_WINSDK
#error "Don't include <winapi/windef.h>"
@@ -565,4 +565,4 @@
// -------------------------------------------------------------------------
// $Log: $
-#endif /* _BOOST_MEMORY_WINAPI_WINDEF_H_ */
+#endif /* BOOST_MEMORY_WINAPI_WINDEF_H */
Modified: sandbox/memory/boost/memory/winapi/wtypes.h
==============================================================================
--- sandbox/memory/boost/memory/winapi/wtypes.h (original)
+++ sandbox/memory/boost/memory/winapi/wtypes.h 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -9,14 +9,14 @@
//
// See http://www.boost.org/libs/memory/index.htm for documentation.
//
-#ifndef _BOOST_MEMORY_WINAPI_WTYPES_H_
-#define _BOOST_MEMORY_WINAPI_WTYPES_H_
+#ifndef BOOST_MEMORY_WINAPI_WTYPES_H
+#define BOOST_MEMORY_WINAPI_WTYPES_H
#if !defined(BOOST_NO_WINSDK)
#error "Don't include <winapi/wtypes.h>"
#endif
-#ifndef _BOOST_MEMORY_WINAPI_WINDEF_H_
+#ifndef BOOST_MEMORY_WINAPI_WINDEF_H
#include "windef.h"
#endif
@@ -232,4 +232,4 @@
// =========================================================================
// $Log: $
-#endif /* _BOOST_MEMORY_WINAPI_WTYPES_H_ */
+#endif /* BOOST_MEMORY_WINAPI_WTYPES_H */
Modified: sandbox/memory/libs/memory/lib/boost-memory.lib
==============================================================================
Binary files. No diff available.
Modified: sandbox/memory/libs/memory/src/block_pool.cpp
==============================================================================
--- sandbox/memory/libs/memory/src/block_pool.cpp (original)
+++ sandbox/memory/libs/memory/src/block_pool.cpp 2008-04-30 14:25:49 EDT (Wed, 30 Apr 2008)
@@ -16,11 +16,11 @@
using namespace boost;
-tls_block_pool_t _tls_blockPool;
+tls_block_pool_t g_tls_blockPool;
STDAPI_(tls_block_pool_t*) _boost_TlsBlockPool()
{
- return &_tls_blockPool;
+ return &g_tls_blockPool;
}
// -------------------------------------------------------------------------
@@ -29,8 +29,8 @@
class tls_block_pool_init
{
public:
- tls_block_pool_init() { _tls_blockPool.init(); }
- ~tls_block_pool_init() { _tls_blockPool.term(); }
+ tls_block_pool_init() { g_tls_blockPool.init(); }
+ ~tls_block_pool_init() { g_tls_blockPool.term(); }
};
tls_block_pool_init _tls_blockPoolInit;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk