From: Jaeyun Date: Thu, 2 Jul 2020 02:40:22 +0000 (+0900) Subject: [Filter/TF] code clean X-Git-Tag: accepted/tizen/unified/20200708.125346~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=160ace3c15d08a5f3146393b4fdc57ae1fdc39f6;p=platform%2Fupstream%2Fnnstreamer.git [Filter/TF] code clean change to static function to release buffer. Signed-off-by: Jaeyun --- diff --git a/ext/nnstreamer/tensor_filter/tensor_filter_tensorflow.cc b/ext/nnstreamer/tensor_filter/tensor_filter_tensorflow.cc index 3fa7695..f9c6025 100644 --- a/ext/nnstreamer/tensor_filter/tensor_filter_tensorflow.cc +++ b/ext/nnstreamer/tensor_filter/tensor_filter_tensorflow.cc @@ -95,6 +95,7 @@ private: tensor_type getTensorTypeFromTF (TF_DataType tfType); TF_DataType getTensorTypeToTF (tensor_type tType); int validateTensor (const GstTensorsInfo * tensorInfo, int is_input); + static void releaseBuffer (void* data, size_t t); }; void init_filter_tf (void) __attribute__ ((constructor)); @@ -192,8 +193,8 @@ TFCore::getModelPath () /** * @brief the definition of a deallocator method */ -static void -DeallocateBuffer (void* data, size_t t) { +void +TFCore::releaseBuffer (void* data, size_t t) { std::free (data); } @@ -232,7 +233,7 @@ TFCore::loadModel () TF_Buffer* buffer = TF_NewBuffer (); buffer->data = content; buffer->length = file_size; - buffer->data_deallocator = DeallocateBuffer; + buffer->data_deallocator = releaseBuffer; graph = TF_NewGraph (); g_assert (graph != nullptr);