wangzhengquan
2020-07-27 df9ea12ea1b0811ef3537a4ecd04cc881348214f
update
6个文件已修改
22 ■■■■ 已修改文件
src/libshm_queue.a 补丁 | 查看 | 原始文档 | blame | 历史
src/queue/include/shm_mm.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/queue/include/shm_queue.h 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/socket/dgram_mod_socket.c 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test_socket/dgram_mod_bus 补丁 | 查看 | 原始文档 | blame | 历史
test_socket/dgram_mod_bus.c 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/libshm_queue.a
Binary files differ
src/queue/include/shm_mm.h
@@ -18,8 +18,6 @@
 */
void shm_destroy();
void* shm_malloc_by_key(int key, int size);
#ifdef __cplusplus
}
src/queue/include/shm_queue.h
@@ -68,8 +68,8 @@
      }
    }
    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);
    }
  }
src/socket/dgram_mod_socket.c
@@ -15,7 +15,7 @@
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;
@@ -108,7 +108,7 @@
    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;
test_socket/dgram_mod_bus
Binary files differ
test_socket/dgram_mod_bus.c
@@ -2,19 +2,9 @@
#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) {