1 //////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // See http://www.boost.org/libs/interprocess for documentation.
9 //////////////////////////////////////////////////////////////////////////////
10 #define BOOST_CONTAINER_ADAPTIVE_NODE_POOL_CHECK_INVARIANTS
11 #include <boost/interprocess/managed_shared_memory.hpp>
12 #include <boost/interprocess/containers/list.hpp>
13 #include <boost/interprocess/containers/vector.hpp>
14 #include <boost/interprocess/allocators/cached_adaptive_pool.hpp>
15 #include "print_container.hpp"
16 #include "dummy_test_allocator.hpp"
17 #include "movable_int.hpp"
18 #include "list_test.hpp"
19 #include "vector_test.hpp"
21 using namespace boost::interprocess
;
23 //We will work with wide characters for shared memory objects
24 //Alias an cached adaptive pool that allocates ints
25 typedef cached_adaptive_pool
26 <int, managed_shared_memory::segment_manager
>
27 cached_node_allocator_t
;
29 typedef ipcdetail::cached_adaptive_pool_v1
30 <int, managed_shared_memory::segment_manager
>
31 cached_node_allocator_v1_t
;
34 namespace interprocess
{
36 //Explicit instantiations to catch compilation errors
37 template class cached_adaptive_pool
<int, managed_shared_memory::segment_manager
>;
38 template class cached_adaptive_pool
<void, managed_shared_memory::segment_manager
>;
42 template class ipcdetail::cached_adaptive_pool_v1
<int, managed_shared_memory::segment_manager
>;
43 template class ipcdetail::cached_adaptive_pool_v1
<void, managed_shared_memory::segment_manager
>;
48 typedef list
<int, cached_node_allocator_t
> MyShmList
;
49 typedef list
<int, cached_node_allocator_v1_t
> MyShmListV1
;
52 typedef vector
<int, cached_node_allocator_t
> MyShmVector
;
53 typedef vector
<int, cached_node_allocator_v1_t
> MyShmVectorV1
;
57 if(test::list_test
<managed_shared_memory
, MyShmList
, true>())
60 if(test::list_test
<managed_shared_memory
, MyShmListV1
, true>())
63 if(test::vector_test
<managed_shared_memory
, MyShmVector
>())
66 if(test::vector_test
<managed_shared_memory
, MyShmVectorV1
>())