From a2236fffa265342454430000a7ff0d710807ebb9 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期四, 30 九月 2021 13:35:38 +0800
Subject: [PATCH] SendReply use BHFree

---
 src/shm/shm_mm.h |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/shm/shm_mm.h b/src/shm/shm_mm.h
index 18c5370..0ca0d08 100644
--- a/src/shm/shm_mm.h
+++ b/src/shm/shm_mm.h
@@ -8,6 +8,8 @@
 #define SHM_QUEUE_ST_CLOSED 1
 #define SHM_QUEUE_ST_RECYCLED 2
 
+#define SHM_QUEUE_ST_SET    50
+
 struct shm_queue_status_t {
 
   int status;
@@ -30,16 +32,14 @@
 
 template <typename T>
 T* shm_mm_attach(int key) {
-	void *ptr;
-	// T* tptr;
-	hashtable_t *hashtable = mm_get_hashtable();
+  void *ptr;
+  // T* tptr;
+  hashtable_t *hashtable = mm_get_hashtable();
   ptr = hashtable_get(hashtable, key);
-// printf("shm_mm_malloc_by_key  malloc before %d, %p\n", key, ptr);
   if(ptr == NULL || ptr == (void *)1 ) {
     ptr = mm_malloc(sizeof(T));
     hashtable_put(hashtable, key, ptr);
     new(ptr) T;
-// printf("shm_mm_malloc_by_key  use new %d, %p\n", key, ptr);
   }
   return (T*)ptr; 
 }
@@ -51,4 +51,6 @@
 
 int shm_mm_alloc_key();
 
-#endif 
\ No newline at end of file
+typedef std::map<SHMString, int, std::less<SHMString>, SHM_STL_Allocator<std::pair<const SHMString, int> > > ProcDataZone;
+
+#endif 

--
Gitblit v1.8.0