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@101
|
14 #ifndef BOOST_CONFIG_HPP
|
Chris@101
|
15 # include <boost/config.hpp>
|
Chris@101
|
16 #endif
|
Chris@101
|
17 #
|
Chris@101
|
18 #if defined(BOOST_HAS_PRAGMA_ONCE)
|
Chris@16
|
19 # pragma once
|
Chris@16
|
20 #endif
|
Chris@16
|
21
|
Chris@16
|
22 #include <boost/interprocess/detail/config_begin.hpp>
|
Chris@16
|
23 #include <boost/interprocess/detail/workaround.hpp>
|
Chris@16
|
24
|
Chris@16
|
25 #include <boost/interprocess/interprocess_fwd.hpp>
|
Chris@16
|
26 #include <boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp>
|
Chris@16
|
27 #include <boost/interprocess/offset_ptr.hpp>
|
Chris@16
|
28
|
Chris@16
|
29 //!\file
|
Chris@16
|
30 //!Describes sequential fit algorithm used to allocate objects in shared memory.
|
Chris@16
|
31
|
Chris@16
|
32 namespace boost {
|
Chris@16
|
33 namespace interprocess {
|
Chris@16
|
34
|
Chris@16
|
35 //!This class implements the simple sequential fit algorithm with a simply
|
Chris@16
|
36 //!linked list of free buffers.
|
Chris@16
|
37 template<class MutexFamily, class VoidPointer>
|
Chris@16
|
38 class simple_seq_fit
|
Chris@16
|
39 : public ipcdetail::simple_seq_fit_impl<MutexFamily, VoidPointer>
|
Chris@16
|
40 {
|
Chris@101
|
41 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
|
Chris@16
|
42 typedef ipcdetail::simple_seq_fit_impl<MutexFamily, VoidPointer> base_t;
|
Chris@101
|
43 #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
|
Chris@16
|
44
|
Chris@16
|
45 public:
|
Chris@16
|
46 typedef typename base_t::size_type size_type;
|
Chris@16
|
47
|
Chris@16
|
48 //!Constructor. "size" is the total size of the managed memory segment,
|
Chris@16
|
49 //!"extra_hdr_bytes" indicates the extra bytes beginning in the sizeof(simple_seq_fit)
|
Chris@16
|
50 //!offset that the allocator should not use at all.*/
|
Chris@16
|
51 simple_seq_fit(size_type segment_size, size_type extra_hdr_bytes)
|
Chris@16
|
52 : base_t(segment_size, extra_hdr_bytes){}
|
Chris@16
|
53 };
|
Chris@16
|
54
|
Chris@16
|
55 } //namespace interprocess {
|
Chris@16
|
56
|
Chris@16
|
57 } //namespace boost {
|
Chris@16
|
58
|
Chris@16
|
59 #include <boost/interprocess/detail/config_end.hpp>
|
Chris@16
|
60
|
Chris@16
|
61 #endif //#ifndef BOOST_INTERPROCESS_SIMPLE_SEQ_FIT_HPP
|
Chris@16
|
62
|