Chris@16
|
1 //////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
2 //
|
Chris@16
|
3 // (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
|
Chris@16
|
4 // Software License, Version 1.0. (See accompanying file
|
Chris@16
|
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6 //
|
Chris@16
|
7 // See http://www.boost.org/libs/interprocess for documentation.
|
Chris@16
|
8 //
|
Chris@16
|
9 //////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
10
|
Chris@16
|
11 #ifndef BOOST_INTERPROCESS_SIMPLE_SEQ_FIT_HPP
|
Chris@16
|
12 #define BOOST_INTERPROCESS_SIMPLE_SEQ_FIT_HPP
|
Chris@16
|
13
|
Chris@16
|
14 #if (defined _MSC_VER) && (_MSC_VER >= 1200)
|
Chris@16
|
15 # pragma once
|
Chris@16
|
16 #endif
|
Chris@16
|
17
|
Chris@16
|
18 #include <boost/interprocess/detail/config_begin.hpp>
|
Chris@16
|
19 #include <boost/interprocess/detail/workaround.hpp>
|
Chris@16
|
20
|
Chris@16
|
21 #include <boost/interprocess/interprocess_fwd.hpp>
|
Chris@16
|
22 #include <boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp>
|
Chris@16
|
23 #include <boost/interprocess/offset_ptr.hpp>
|
Chris@16
|
24
|
Chris@16
|
25 //!\file
|
Chris@16
|
26 //!Describes sequential fit algorithm used to allocate objects in shared memory.
|
Chris@16
|
27
|
Chris@16
|
28 namespace boost {
|
Chris@16
|
29 namespace interprocess {
|
Chris@16
|
30
|
Chris@16
|
31 //!This class implements the simple sequential fit algorithm with a simply
|
Chris@16
|
32 //!linked list of free buffers.
|
Chris@16
|
33 template<class MutexFamily, class VoidPointer>
|
Chris@16
|
34 class simple_seq_fit
|
Chris@16
|
35 : public ipcdetail::simple_seq_fit_impl<MutexFamily, VoidPointer>
|
Chris@16
|
36 {
|
Chris@16
|
37 /// @cond
|
Chris@16
|
38 typedef ipcdetail::simple_seq_fit_impl<MutexFamily, VoidPointer> base_t;
|
Chris@16
|
39 /// @endcond
|
Chris@16
|
40
|
Chris@16
|
41 public:
|
Chris@16
|
42 typedef typename base_t::size_type size_type;
|
Chris@16
|
43
|
Chris@16
|
44 //!Constructor. "size" is the total size of the managed memory segment,
|
Chris@16
|
45 //!"extra_hdr_bytes" indicates the extra bytes beginning in the sizeof(simple_seq_fit)
|
Chris@16
|
46 //!offset that the allocator should not use at all.*/
|
Chris@16
|
47 simple_seq_fit(size_type segment_size, size_type extra_hdr_bytes)
|
Chris@16
|
48 : base_t(segment_size, extra_hdr_bytes){}
|
Chris@16
|
49 };
|
Chris@16
|
50
|
Chris@16
|
51 } //namespace interprocess {
|
Chris@16
|
52
|
Chris@16
|
53 } //namespace boost {
|
Chris@16
|
54
|
Chris@16
|
55 #include <boost/interprocess/detail/config_end.hpp>
|
Chris@16
|
56
|
Chris@16
|
57 #endif //#ifndef BOOST_INTERPROCESS_SIMPLE_SEQ_FIT_HPP
|
Chris@16
|
58
|