… | |
… | |
10 | slice_allocator () noexcept { } |
10 | slice_allocator () noexcept { } |
11 | template<typename Tp2> |
11 | template<typename Tp2> |
12 | slice_allocator (const slice_allocator<Tp2> &) noexcept { } |
12 | slice_allocator (const slice_allocator<Tp2> &) noexcept { } |
13 | ~slice_allocator () noexcept { } |
13 | ~slice_allocator () noexcept { } |
14 | |
14 | |
|
|
15 | template <class U> |
|
|
16 | bool operator == (const slice_allocator<U> &) noexcept { return true ; } |
|
|
17 | template <class U> |
|
|
18 | bool operator != (const slice_allocator<U> &) noexcept { return false; } |
|
|
19 | |
15 | Tp *allocate (std::size_t n) |
20 | Tp *allocate (std::size_t n) |
16 | { |
21 | { |
17 | return (Tp *)g_slice_alloc (n * sizeof (Tp)); |
22 | return (Tp *)g_slice_alloc (n * sizeof (Tp)); |
18 | } |
23 | } |
19 | |
24 | |
… | |
… | |
21 | { |
26 | { |
22 | g_slice_free1 (n * sizeof (Tp), p); |
27 | g_slice_free1 (n * sizeof (Tp), p); |
23 | } |
28 | } |
24 | }; |
29 | }; |
25 | |
30 | |
26 | template <class T, class U> |
|
|
27 | bool operator == (const slice_allocator<T>&, const slice_allocator<U>&) noexcept { return true ; } |
|
|
28 | template <class T, class U> |
|
|
29 | bool operator != (const slice_allocator<T>&, const slice_allocator<U>&) noexcept { return false; } |
|
|
30 | |
|
|
31 | #endif |
31 | #endif |