diff --git a/dtool/src/dtoolbase/pallocator.T b/dtool/src/dtoolbase/pallocator.T index ed8349debe..0a92caee20 100644 --- a/dtool/src/dtoolbase/pallocator.T +++ b/dtool/src/dtoolbase/pallocator.T @@ -20,7 +20,7 @@ pallocator_single(TypeHandle type_handle) noexcept : template INLINE Type *pallocator_single:: -allocate(typename pallocator_single::size_type n, typename std::allocator::const_pointer) { +allocate(typename pallocator_single::size_type n, const void *) { TAU_PROFILE("pallocator_single:allocate()", " ", TAU_USER); // This doesn't support allocating arrays. assert(n == 1); @@ -30,7 +30,7 @@ allocate(typename pallocator_single::size_type n, typename std::allocator< template INLINE void pallocator_single:: -deallocate(typename pallocator_single::pointer p, typename pallocator_single::size_type) { +deallocate(Type *p, typename pallocator_single::size_type) { TAU_PROFILE("pallocator_single:deallocate()", " ", TAU_USER); StaticDeletedChain::deallocate(p, _type_handle); } @@ -44,13 +44,13 @@ pallocator_array(TypeHandle type_handle) noexcept : template INLINE Type *pallocator_array:: -allocate(typename pallocator_array::size_type n, typename std::allocator::const_pointer) { - return (typename pallocator_array::pointer) +allocate(typename pallocator_array::size_type n, const void *) { + return (Type *) ASSUME_ALIGNED(_type_handle.allocate_array(n * sizeof(Type)), MEMORY_HOOK_ALIGNMENT); } template INLINE void pallocator_array:: -deallocate(typename pallocator_array::pointer p, typename pallocator_array::size_type) { +deallocate(Type *p, typename pallocator_array::size_type) { _type_handle.deallocate_array((void *)p); } diff --git a/dtool/src/dtoolbase/pallocator.h b/dtool/src/dtoolbase/pallocator.h index d61ca64ceb..77fe34f50c 100644 --- a/dtool/src/dtoolbase/pallocator.h +++ b/dtool/src/dtoolbase/pallocator.h @@ -46,10 +46,10 @@ class pallocator_single : public std::allocator { public: // Nowadays we cannot implicitly inherit typedefs from base classes in a // template class; we must explicitly copy them here. - typedef typename std::allocator::pointer pointer; - typedef typename std::allocator::reference reference; - typedef typename std::allocator::const_pointer const_pointer; - typedef typename std::allocator::const_reference const_reference; + typedef Type *pointer; + typedef Type &reference; + typedef const Type *const_pointer; + typedef const Type &const_reference; typedef typename std::allocator::size_type size_type; INLINE pallocator_single(TypeHandle type_handle) noexcept; @@ -59,9 +59,9 @@ public: INLINE pallocator_single(const pallocator_single ©) noexcept : _type_handle(copy._type_handle) { } - INLINE Type *allocate(size_type n, std::allocator::const_pointer hint = 0) + INLINE Type *allocate(size_type n, const void *hint = 0) RETURNS_ALIGNED(MEMORY_HOOK_ALIGNMENT); - INLINE void deallocate(pointer p, size_type n); + INLINE void deallocate(Type *p, size_type n); template struct rebind { typedef pallocator_single other; @@ -75,10 +75,10 @@ class pallocator_array : public std::allocator { public: // Nowadays we cannot implicitly inherit typedefs from base classes in a // template class; we must explicitly copy them here. - typedef typename std::allocator::pointer pointer; - typedef typename std::allocator::reference reference; - typedef typename std::allocator::const_pointer const_pointer; - typedef typename std::allocator::const_reference const_reference; + typedef Type *pointer; + typedef Type &reference; + typedef const Type *const_pointer; + typedef const Type &const_reference; typedef typename std::allocator::size_type size_type; INLINE pallocator_array(TypeHandle type_handle = TypeHandle::none()) noexcept; @@ -88,9 +88,9 @@ public: INLINE pallocator_array(const pallocator_array ©) noexcept : _type_handle(copy._type_handle) { } - INLINE Type *allocate(size_type n, std::allocator::const_pointer hint = 0) + INLINE Type *allocate(size_type n, const void *hint = 0) RETURNS_ALIGNED(MEMORY_HOOK_ALIGNMENT); - INLINE void deallocate(pointer p, size_type n); + INLINE void deallocate(Type *p, size_type n); template struct rebind { typedef pallocator_array other;