diff options
author | robot-piglet <[email protected]> | 2023-12-02 01:45:21 +0300 |
---|---|---|
committer | robot-piglet <[email protected]> | 2023-12-02 02:42:50 +0300 |
commit | 9c43d58f75cf086b744cf4fe2ae180e8f37e4a0c (patch) | |
tree | 9f88a486917d371d099cd712efd91b4c122d209d /contrib/tools/swig/Lib/std/std_alloc.i | |
parent | 32fb6dda1feb24f9ab69ece5df0cb9ec238ca5e6 (diff) |
Intermediate changes
Diffstat (limited to 'contrib/tools/swig/Lib/std/std_alloc.i')
-rw-r--r-- | contrib/tools/swig/Lib/std/std_alloc.i | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/contrib/tools/swig/Lib/std/std_alloc.i b/contrib/tools/swig/Lib/std/std_alloc.i new file mode 100644 index 00000000000..e460dc3eaf8 --- /dev/null +++ b/contrib/tools/swig/Lib/std/std_alloc.i @@ -0,0 +1,77 @@ +namespace std +{ + /** + * @brief The "standard" allocator, as per [20.4]. + * + * The private _Alloc is "SGI" style. (See comments at the top + * of stl_alloc.h.) + * + * The underlying allocator behaves as follows. + * - __default_alloc_template is used via two typedefs + * - "__single_client_alloc" typedef does no locking for threads + * - "__alloc" typedef is threadsafe via the locks + * - __new_alloc is used for memory requests + * + * (See @link Allocators allocators info @endlink for more.) + */ + template<typename _Tp> + class allocator + { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef _Tp* pointer; + typedef const _Tp* const_pointer; + typedef _Tp& reference; + typedef const _Tp& const_reference; + typedef _Tp value_type; + + template<typename _Tp1> + struct rebind; + + allocator() throw(); + + allocator(const allocator& other) throw(); + template<typename _Tp1> + allocator(const allocator<_Tp1>& other) throw(); + ~allocator() throw(); + + + pointer + address(reference __x) const; + + + const_pointer + address(const_reference __x) const; + + + // NB: __n is permitted to be 0. The C++ standard says nothing + // about what the return value is when __n == 0. + _Tp* + allocate(size_type __n, const void* = 0); + + // __p is not permitted to be a null pointer. + void + deallocate(pointer __p, size_type __n); + + size_type + max_size() const throw(); + + void construct(pointer __p, const _Tp& __val); + void destroy(pointer __p); + }; + + template<> + class allocator<void> + { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef void* pointer; + typedef const void* const_pointer; + typedef void value_type; + + template<typename _Tp1> + struct rebind; + }; +} // namespace std |