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/shm_mm.cpp | 21 --------------------- 1 files changed, 0 insertions(+), 21 deletions(-) diff --git a/src/shm/shm_mm.cpp b/src/shm/shm_mm.cpp index 6341086..1fcf604 100644 --- a/src/shm/shm_mm.cpp +++ b/src/shm/shm_mm.cpp @@ -23,21 +23,6 @@ } -template <typename T> - T* shm_mm_attach(int key) { - 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; -} void shm_mm_free_by_key(int key) { return mm_free_by_key(key); @@ -52,9 +37,3 @@ return mm_alloc_key(); } - - -// extern int mm_checkheap(int verbose); - - -#endif \ No newline at end of file -- Gitblit v1.8.0