simple_seq_fit.hpp 1.9 KB

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