Usermode/libc++ - Debug in cxa code, list emplace and iterators, general STL fixes
[tpg/acess2.git] / Usermode / Libraries / libc++.so_src / include_exp / allocator
index 0bb12ea..6057eb3 100644 (file)
@@ -8,7 +8,11 @@
 #ifndef _LIBCXX_ALLOCATOR_
 #define _LIBCXX_ALLOCATOR_
 
+#include "_libcxx_helpers.h"
+
+#include "new"
 #include "cstddef"
+#include "utility"
 
 namespace std {
 
@@ -31,7 +35,7 @@ public:
        
        allocator() throw() {
        }
-       allocator(const allocator& alloc) throw() {
+       allocator(const allocator& alloc __attribute__((unused))) throw() {
        }
        template <class U>
        allocator(const allocator<U>& alloc) throw() {
@@ -46,11 +50,29 @@ public:
                return &x;
        }
        pointer allocate(size_type n, const void* hint=0) {
-               ::operator new (n * sizeof(value_type));
+               hint = hint;
+               return static_cast<pointer>( ::operator new (n * sizeof(value_type)) );
        }
        void deallocate(pointer p, size_type n) {
+               n=n;
                ::operator delete(p);
        }
+       size_type max_size() {
+               return ((size_type)-1) / sizeof(value_type);
+       }
+       void construct( pointer p, const_reference val ) {
+               new ((void*)p) value_type (val);
+       }
+       // C++11
+       #if _CXX11_AVAIL
+       template<class U, class... Args>
+       void construct( U* p, Args&&... args ) {
+               ::new ((void*)p) U (::std::forward<Args>(args)...);
+       }
+       #endif
+       void destroy(pointer p) {
+               p->~value_type();
+       }
 };
 
 };

UCC git Repository :: git.ucc.asn.au