Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <boost/interprocess/mapped_region.hpp>
- #include <boost/interprocess/managed_shared_memory.hpp>
- #include <boost/interprocess/managed_windows_shared_memory.hpp>
- #include <boost/interprocess/allocators/allocator.hpp>
- #include <boost/interprocess/containers/map.hpp>
- using namespace boost::interprocess;
- typedef void* mem_managed_type; // GLE_GLOBAL is just void *, but changing it to int doesn't work
- struct global_ptr_state; // This is just a POD struct, the definition doesn't matter
- //typedef managed_shared_memory mem_manager_t;
- typedef managed_windows_shared_memory mem_manager_t;
- typedef std::pair<const mem_managed_type, global_ptr_state> global_state_pair;
- typedef mem_manager_t::segment_manager segm_t;
- typedef allocator< global_state_pair, segm_t > my_global_allocator;
- typedef std::less<mem_managed_type> mem_managed_type_less;
- typedef mem_manager_t::segment_manager segm_manager;
- typedef map<const mem_managed_type, global_ptr_state, mem_managed_type_less, my_global_allocator> global_ptr_pair_map;
- int _tmain(int argc, _TCHAR* argv[])
- {
- segm_manager *_segm_manager;
- my_global_allocator *_allocatr;
- global_ptr_pair_map *global_map;
- mem_manager_t managed_pool;
- managed_pool = mem_manager_t(create_only, "thisdoesntmatter", 65536, (void *)0x3C000000);
- shared_memory_object _stator_share(open_only, "thisdoesntmattereither", read_write);
- mapped_region _stator_region(_stator_share, read_write, 0, 0, (void *)GLE_STATOR_ADDR);
- _segm_manager = managed_pool.get_segment_manager();
- _allocatr = new my_global_allocator(_segm_manager);
- // This line throws the error
- global_map = new global_ptr_pair_map; // This line causes the error
- }
Advertisement
Add Comment
Please, Sign In to add comment