From 5545e2f4cdacc4243d9c617e8d26a23876ba2dd0 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sat, 14 Mar 2015 10:53:38 -0700 Subject: [PATCH] Cleanup: Drop unused CBDATA free_func parameter --- src/cbdata.cc | 20 +++----------------- src/cbdata.h | 4 ++-- src/tests/stub_cbdata.cc | 2 +- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/cbdata.cc b/src/cbdata.cc index 390e69179b..971c2b910b 100644 --- a/src/cbdata.cc +++ b/src/cbdata.cc @@ -136,7 +136,6 @@ static OBJH cbdataDumpHistory; struct CBDataIndex { MemAllocator *pool; - FREE *free_func; } *cbdata_index = NULL; @@ -168,21 +167,10 @@ cbdata::~cbdata() } #endif - - FREE *free_func = cbdata_index[type].free_func; - -#if HASHED_CBDATA - void *p = hash.key; -#else - void *p = &data; -#endif - - if (free_func) - free_func(p); } static void -cbdataInternalInitType(cbdata_type type, const char *name, int size, FREE * free_func) +cbdataInternalInitType(cbdata_type type, const char *name, int size) { char *label; assert (type == cbdata_types + 1); @@ -202,8 +190,6 @@ cbdataInternalInitType(cbdata_type type, const char *name, int size, FREE * free cbdata_index[type].pool = memPoolCreate(label, size); - cbdata_index[type].free_func = free_func; - #if HASHED_CBDATA if (!cbdata_htable) cbdata_htable = hash_create(cbdata_cmp, 1 << 12, cbdata_hash); @@ -211,14 +197,14 @@ cbdataInternalInitType(cbdata_type type, const char *name, int size, FREE * free } cbdata_type -cbdataInternalAddType(cbdata_type type, const char *name, int size, FREE * free_func) +cbdataInternalAddType(cbdata_type type, const char *name, int size) { if (type) return type; type = (cbdata_type)(cbdata_types + 1); - cbdataInternalInitType(type, name, size, free_func); + cbdataInternalInitType(type, name, size); return type; } diff --git a/src/cbdata.h b/src/cbdata.h index c28c1c4b3c..5a94aebdc1 100644 --- a/src/cbdata.h +++ b/src/cbdata.h @@ -272,7 +272,7 @@ int cbdataReferenceValid(const void *p); * * \note For internal CBDATA use only. */ -cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, int size, FREE * free_func); +cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, int size); /** * This needs to be defined FIRST in the class definition. @@ -282,7 +282,7 @@ cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, int size, public: \ void *operator new(size_t size) { \ assert(size == sizeof(type)); \ - if (!CBDATA_##type) CBDATA_##type = cbdataInternalAddType(CBDATA_##type, #type, sizeof(type), NULL); \ + if (!CBDATA_##type) CBDATA_##type = cbdataInternalAddType(CBDATA_##type, #type, sizeof(type)); \ return (type *)cbdataInternalAlloc(CBDATA_##type,__FILE__,__LINE__); \ } \ void operator delete (void *address) { \ diff --git a/src/tests/stub_cbdata.cc b/src/tests/stub_cbdata.cc index 1e2fd20842..df3712c199 100644 --- a/src/tests/stub_cbdata.cc +++ b/src/tests/stub_cbdata.cc @@ -27,5 +27,5 @@ int cbdataInternalReferenceDoneValid(void **p, void **tp) STUB_RETVAL(0) #endif int cbdataReferenceValid(const void *p) STUB_RETVAL(0) -cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, int size, FREE * free_func) STUB_RETVAL(CBDATA_UNKNOWN) +cbdata_type cbdataInternalAddType(cbdata_type, const char *, int) STUB_RETVAL(CBDATA_UNKNOWN) -- 2.47.2