diff options
Diffstat (limited to 'Source/ThirdParty/ANGLE/src/compiler/PoolAlloc.h')
-rw-r--r-- | Source/ThirdParty/ANGLE/src/compiler/PoolAlloc.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/Source/ThirdParty/ANGLE/src/compiler/PoolAlloc.h b/Source/ThirdParty/ANGLE/src/compiler/PoolAlloc.h index 051dc00..a8a59c6 100644 --- a/Source/ThirdParty/ANGLE/src/compiler/PoolAlloc.h +++ b/Source/ThirdParty/ANGLE/src/compiler/PoolAlloc.h @@ -253,12 +253,18 @@ public: pointer address(reference x) const { return &x; } const_pointer address(const_reference x) const { return &x; } - pool_allocator() : allocator(GlobalPoolAllocator) { } - pool_allocator(TPoolAllocator& a) : allocator(a) { } + pool_allocator() : allocator(&GlobalPoolAllocator) { } + pool_allocator(TPoolAllocator& a) : allocator(&a) { } pool_allocator(const pool_allocator<T>& p) : allocator(p.allocator) { } + template <class Other> + pool_allocator<T>& operator=(const pool_allocator<Other>& p) { + allocator = p.allocator; + return *this; + } + template<class Other> - pool_allocator(const pool_allocator<Other>& p) : allocator(p.getAllocator()) { } + pool_allocator(const pool_allocator<Other>& p) : allocator(&p.getAllocator()) { } #if defined(__SUNPRO_CC) && !defined(_RWSTD_ALLOCATOR) // libCStd on some platforms have a different allocate/deallocate interface. @@ -290,11 +296,11 @@ public: size_type max_size() const { return static_cast<size_type>(-1) / sizeof(T); } size_type max_size(int size) const { return static_cast<size_type>(-1) / size; } - void setAllocator(TPoolAllocator* a) { allocator = *a; } - TPoolAllocator& getAllocator() const { return allocator; } + void setAllocator(TPoolAllocator* a) { allocator = a; } + TPoolAllocator& getAllocator() const { return *allocator; } protected: - TPoolAllocator& allocator; + TPoolAllocator* allocator; }; -#endif // _POOLALLOC_INCLUDED_
\ No newline at end of file +#endif // _POOLALLOC_INCLUDED_ |