diff --git a/plugins/experimental/cookie_remap/cookie_remap.cc b/plugins/experimental/cookie_remap/cookie_remap.cc index 6e9dd9b24b5..5515497ca00 100644 --- a/plugins/experimental/cookie_remap/cookie_remap.cc +++ b/plugins/experimental/cookie_remap/cookie_remap.cc @@ -43,21 +43,6 @@ using namespace std; const int OVECCOUNT = 30; // We support $1 - $9 only, and this needs to be 3x that -/////////////////////////////////////////////////////////////////////////////// -// Helpers for memory management (to make sure pcre uses the TS APIs). -// -inline void * -ink_malloc(size_t s) -{ - return TSmalloc(s); -} - -inline void -ink_free(void *s) -{ - return TSfree(s); -} - class UrlComponents { public: @@ -182,13 +167,6 @@ class UrlComponents } }; -void -setup_memory_allocation() -{ - pcre_malloc = &ink_malloc; - pcre_free = &ink_free; -} - enum operation_type { UNKNOWN = -1, EXISTS = 1, NOTEXISTS, REGEXP, STRING, BUCKET }; enum target_type { @@ -914,8 +892,6 @@ using OpsQueue = std::vector; TSReturnCode TSRemapInit(TSRemapInterface *api_info, char *errbuf, int errbuf_size) { - setup_memory_allocation(); - return TS_SUCCESS; } diff --git a/plugins/regex_remap/regex_remap.cc b/plugins/regex_remap/regex_remap.cc index b640d3389b9..94123018328 100644 --- a/plugins/regex_remap/regex_remap.cc +++ b/plugins/regex_remap/regex_remap.cc @@ -638,28 +638,6 @@ struct RemapInstance { std::string filename; }; -/////////////////////////////////////////////////////////////////////////////// -// Helpers for memory management (to make sure pcre uses the TS APIs). -// -inline void * -ts_malloc(size_t s) -{ - return TSmalloc(s); -} - -inline void -ts_free(void *s) -{ - return TSfree(s); -} - -void -setup_memory_allocation() -{ - pcre_malloc = &ts_malloc; - pcre_free = &ts_free; -} - /////////////////////////////////////////////////////////////////////////////// // Initialize the plugin. // @@ -677,7 +655,6 @@ TSRemapInit(TSRemapInterface *api_info, char *errbuf, int errbuf_size) return TS_ERROR; } - setup_memory_allocation(); TSDebug(PLUGIN_NAME, "Plugin is successfully initialized"); return TS_SUCCESS; } diff --git a/plugins/regex_revalidate/regex_revalidate.c b/plugins/regex_revalidate/regex_revalidate.c index 52a9e970fe8..2fa32c5e5e4 100644 --- a/plugins/regex_revalidate/regex_revalidate.c +++ b/plugins/regex_revalidate/regex_revalidate.c @@ -45,18 +45,6 @@ #define LOG_ROLL_INTERVAL 86400 #define LOG_ROLL_OFFSET 0 -static inline void * -ts_malloc(size_t s) -{ - return TSmalloc(s); -} - -static inline void -ts_free(void *s) -{ - return TSfree(s); -} - typedef struct invalidate_t { const char *regex_text; pcre *regex; @@ -519,9 +507,6 @@ TSPluginInit(int argc, const char *argv[]) TSDebug(LOG_PREFIX, "Plugin registration succeeded"); } - pcre_malloc = &ts_malloc; - pcre_free = &ts_free; - main_cont = TSContCreate(main_handler, NULL); TSContDataSet(main_cont, (void *)pstate); TSHttpHookAdd(TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK, main_cont);