From 68d23225a38a35f1325eb39fa4ed5a005d5de473 Mon Sep 17 00:00:00 2001
From: fujuntang <fujuntang@aiot.com>
Date: 星期三, 11 八月 2021 09:50:20 +0800
Subject: [PATCH] fix from 3.1 first commit

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

diff --git a/src/shm/mm.cpp b/src/shm/mm.cpp
index d7cc375..e55192c 100644
--- a/src/shm/mm.cpp
+++ b/src/shm/mm.cpp
@@ -113,7 +113,6 @@
 
   newsize = ALIGN(size +  (SIZE_T_SIZE << 1) +  (PTR_SIZE << 1) );
 
-    //fprintf(stderr, "mm_malloc : size=%u\n", size);
   /* Search the free list for a fit */
   SemUtil::dec(mutex);
   if ((ptr = find_fit(newsize)) != NULL)
@@ -123,7 +122,8 @@
     return aptr;
   } else {
     SemUtil::inc(mutex);
-    err_msg(0, "mm_malloc : out of memery\n");
+    // abort();
+    err_exit(0, "mm_malloc : out of memery\n");
     return NULL;
   }
 
@@ -228,6 +228,7 @@
 
 /*
  * mm_init - Initialize the memory manager, M unit
+ * @return 鏄惁绗竴娆″垱寤�
  */
 bool mm_init(size_t heap_size)
 {
@@ -300,16 +301,17 @@
   return first;
 }
 
-
+/**
+ * @return 鏄惁鐪熸閿�姣佹垚鍔�
+ */
 bool mm_destroy(void) {
   struct shmid_ds shmid_ds;
- 
   
   SemUtil::dec(mutex);
   
   if(shmctl(shmid, IPC_STAT, &shmid_ds) == 0) {
     //LoggerFactory::getLogger()->debug("shm_nattch=%d\n", shmid_ds.shm_nattch);
-    // 鍙湁褰撳墠涓�涓繘绋媋ttach鍒板叡浜唴瀛樹笂
+    // 澶氫釜杩涚▼attach鍦ㄥ叡浜唴瀛樹笂
     if (shmid_ds.shm_nattch > 1) {
       //detache
       if (shmdt(shmp) == -1) {
@@ -318,7 +320,7 @@
       SemUtil::inc(mutex);
       return false;
     } else  {
-      
+      // 鍙湁褰撳墠涓�涓繘绋媋ttach鍒板叡浜唴瀛樹笂
       hashtable_destroy(hashtable);
       //detache
       if (shmdt(shmp) == -1) {

--
Gitblit v1.8.0