| | |
| | | */ |
| | | void shm_destroy(); |
| | | |
| | | void* shm_malloc_by_key(int key, int size); |
| | | |
| | | |
| | | #ifdef __cplusplus |
| | | } |
| | |
| | | } |
| | | } |
| | | if (!found) { |
| | | // mqueue = (LockFreeQueue<ELEM_T, SHM_Allocator> *)hashtable_get(hashtable, *keyItr); |
| | | // delete mqueue; |
| | | mqueue = (LockFreeQueue<ELEM_T, SHM_Allocator> *)hashtable_get(hashtable, *keyItr); |
| | | delete mqueue; |
| | | hashtable_remove(hashtable, *keyItr); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | static Logger logger = LoggerFactory::getLogger(); |
| | | |
| | | #define BUS_MAP_KEY 1 |
| | | //typedef std::basic_string<char, std::char_traits<char>, SHM_STL_Allocator<char> > SHMString; |
| | | typedef std::set<int, std::less<int>, SHM_STL_Allocator<int> > SHMKeySet; |
| | | typedef std::map<SHMString, SHMKeySet *, std::less<SHMString>, SHM_STL_Allocator<std::pair<SHMString, SHMKeySet *> > > SHMTopicSubMap; |
| | |
| | | dgram_mod_socket_t * socket = (dgram_mod_socket_t *) _socket; |
| | | printf("mem_pool_malloc_by_key before\n"); |
| | | // void *map_ptr = mem_pool_malloc_by_key(1, sizeof(SHMTopicSubMap)); |
| | | socket->topic_sub_map = mem_pool_attach<SHMTopicSubMap>(1); |
| | | socket->topic_sub_map = mem_pool_attach<SHMTopicSubMap>(BUS_MAP_KEY); |
| | | printf("mem_pool_malloc_by_key after\n"); |
| | | |
| | | // socket->topic_sub_map = new(map_ptr) SHMTopicSubMap; |
| | |
| | | #include "shm_mm.h" |
| | | #include "usg_common.h" |
| | | #include "mm.h" |
| | | |
| | | void sigint_handler(int sig) { |
| | | printf("sigint_handler\n"); |
| | | hashtable_t *hashtable = mm_get_hashtable(); |
| | | //hashtable_remove(hashtable, 8); |
| | | // dgram_mod_close_socket(server_socket); |
| | | //SHMQueue<ELEM_T>::remove_queues_include |
| | | exit(0); |
| | | } |
| | | |
| | | |
| | | |
| | | void server(int port, bool restart) { |
| | | //signal(SIGINT, sigint_handler); |
| | | void * server_socket = dgram_mod_open_socket(); |
| | | |
| | | if(restart) { |