annotate lib/swig/swigwin-2.0.11/Lib/std/std_alloc.i @ 2194:d0e321190c86

Merge
author Grumpy7
date Thu, 30 Jan 2014 22:11:28 +0100
parents b3009adc0e2f
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 namespace std
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2 {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3 /**
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4 * @brief The "standard" allocator, as per [20.4].
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5 *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6 * The private _Alloc is "SGI" style. (See comments at the top
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7 * of stl_alloc.h.)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8 *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9 * The underlying allocator behaves as follows.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 * - __default_alloc_template is used via two typedefs
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11 * - "__single_client_alloc" typedef does no locking for threads
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12 * - "__alloc" typedef is threadsafe via the locks
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13 * - __new_alloc is used for memory requests
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15 * (See @link Allocators allocators info @endlink for more.)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17 template<typename _Tp>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18 class allocator
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19 {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20 public:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21 typedef size_t size_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22 typedef ptrdiff_t difference_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23 typedef _Tp* pointer;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24 typedef const _Tp* const_pointer;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25 typedef _Tp& reference;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26 typedef const _Tp& const_reference;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27 typedef _Tp value_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29 template<typename _Tp1>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 struct rebind;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32 allocator() throw();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34 allocator(const allocator&) throw();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35 template<typename _Tp1>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
36 allocator(const allocator<_Tp1>&) throw();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
37 ~allocator() throw();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
38
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 pointer
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
41 address(reference __x) const;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
42
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
43
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
44 const_pointer
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
45 address(const_reference __x) const;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
46
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
47
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
48 // NB: __n is permitted to be 0. The C++ standard says nothing
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
49 // about what the return value is when __n == 0.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
50 _Tp*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
51 allocate(size_type __n, const void* = 0);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
52
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
53 // __p is not permitted to be a null pointer.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
54 void
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
55 deallocate(pointer __p, size_type __n);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
56
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
57 size_type
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
58 max_size() const throw();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
59
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
60 void construct(pointer __p, const _Tp& __val);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
61 void destroy(pointer __p);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
62 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
63
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
64 template<>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
65 class allocator<void>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
66 {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
67 public:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
68 typedef size_t size_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
69 typedef ptrdiff_t difference_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
70 typedef void* pointer;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
71 typedef const void* const_pointer;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
72 typedef void value_type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
73
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
74 template<typename _Tp1>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
75 struct rebind;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
76 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
77 } // namespace std