osaf/libs/core/leap/hj_hdl.c          |  13 ++++++-------
 osaf/libs/core/leap/include/ncs_hdl.h |  25 -------------------------
 2 files changed, 6 insertions(+), 32 deletions(-)


diff --git a/osaf/libs/core/leap/hj_hdl.c b/osaf/libs/core/leap/hj_hdl.c
--- a/osaf/libs/core/leap/hj_hdl.c
+++ b/osaf/libs/core/leap/hj_hdl.c
@@ -245,9 +245,9 @@ void ncshm_delete(void)
                if ((unit = gl_hm.unit[i]) != NULL) {
                        for (j = 0; j < HM_BANK_CNT; j++) {
                                if (unit->cells[j] != NULL)
-                                       m_MMGR_FREE_HM_CELLS(unit->cells[j]);
+                                       free(unit->cells[j]);
                        }
-                       m_MMGR_FREE_HM_UNIT(unit);
+                       free(unit);
                }
        }
 
@@ -553,7 +553,7 @@ uint32_t hm_make_free_cells(HM_PMGR *pmg
        /* first time this pool has been used ?? */
 
        if (unit == NULL) {
-               if ((unit = m_MMGR_ALLOC_HM_UNIT) == NULL)
+               if ((unit = (HM_UNIT*) malloc(sizeof(HM_UNIT))) == NULL)
                        return m_LEAP_DBG_SINK(NCSCC_RC_FAILURE);
 
                memset(unit, 0, sizeof(HM_UNIT));
@@ -570,8 +570,7 @@ uint32_t hm_make_free_cells(HM_PMGR *pmg
        }
 
        /* Now go make HM_CELL_CNT (4096) new cells */
-
-       if ((cells = m_MMGR_ALLOC_HM_CELLS) == NULL)
+       if ((cells = (HM_CELLS*) malloc(sizeof(HM_CELLS))) == NULL)
                return m_LEAP_DBG_SINK(NCSCC_RC_FAILURE);
 
        memset(cells, 0, sizeof(HM_CELLS));
@@ -622,7 +621,7 @@ HM_FREE *hm_target_cell(HM_HDL *hdl)
        pmgr = &gl_hm.pool[m_HM_POOL_ID((uint8_t)hdl->idx1)];   /* determine 
pool */
 
        if ((unit = gl_hm.unit[hdl->idx1]) == NULL) {
-               if ((unit = m_MMGR_ALLOC_HM_UNIT) == NULL) {
+               if ((unit = (HM_UNIT*)  malloc(sizeof(HM_UNIT))) == NULL) {
                        m_LEAP_DBG_SINK(NULL);
                        return NULL;
                }
@@ -632,7 +631,7 @@ HM_FREE *hm_target_cell(HM_HDL *hdl)
        }
 
        if ((cells = unit->cells[hdl->idx2]) == NULL) {
-               if ((cells = m_MMGR_ALLOC_HM_CELLS) == NULL) {
+               if ((cells = (HM_CELLS*) malloc(sizeof(HM_CELLS))) == NULL) {
                        m_LEAP_DBG_SINK(NULL);
                        return NULL;
                }
diff --git a/osaf/libs/core/leap/include/ncs_hdl.h 
b/osaf/libs/core/leap/include/ncs_hdl.h
--- a/osaf/libs/core/leap/include/ncs_hdl.h
+++ b/osaf/libs/core/leap/include/ncs_hdl.h
@@ -282,31 +282,6 @@ typedef struct hm_core {
 #define m_HM_STAT_RMV_IN_USE(r,n)
 #endif
 
-/*************************************************************************** 
- * Required Memory Management Macros for Handle Manager
- ***************************************************************************/
-
-#define m_MMGR_ALLOC_HM_CELLS      (HM_CELLS*) 
m_NCS_MEM_ALLOC(sizeof(HM_CELLS),\
-                                               NCS_MEM_REGION_PERSISTENT, \
-                                               NCS_SERVICE_ID_COMMON,     \
-                                               0)
-#define m_MMGR_ALLOC_HM_UNIT       (HM_UNIT*)  
m_NCS_MEM_ALLOC(sizeof(HM_UNIT),\
-                                               NCS_MEM_REGION_PERSISTENT, \
-                                               NCS_SERVICE_ID_COMMON,     \
-                                               0)
-
-/* The Free cases */
-
-#define m_MMGR_FREE_HM_CELLS(p)                m_NCS_MEM_FREE(p,            \
-                                               NCS_MEM_REGION_PERSISTENT,   \
-                                               NCS_SERVICE_ID_COMMON,       \
-                                               0)
-
-#define m_MMGR_FREE_HM_UNIT(p)                 m_NCS_MEM_FREE(p,            \
-                                               NCS_MEM_REGION_PERSISTENT,   \
-                                               NCS_SERVICE_ID_COMMON,       \
-                                               0)
-
 /***************************************************************************
  *
  * P r i v a t e  (i n t e r n a l)  H a n d l e   M g r   F u n c t i o n s

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to