diff options
author | Mike Holmes <mike.holmes@linaro.org> | 2014-12-31 08:28:16 -0500 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-01-12 20:08:07 +0300 |
commit | a86260290cc497911af59b4642f5829ff2b93910 (patch) | |
tree | 8431188f998e4cd3ba02e6107276bd9f73f465c3 /helper | |
parent | 6025a952dc33c121b0972a9e96256bb86e2b72d6 (diff) |
linux-generic: odp_linux: fix memory leak
Store the start_args so that they can be freed on join
Fixes numerous leaks reported by valgrind
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'helper')
-rw-r--r-- | helper/include/odph_linux.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/helper/include/odph_linux.h b/helper/include/odph_linux.h index 4ed8bbe..26ff278 100644 --- a/helper/include/odph_linux.h +++ b/helper/include/odph_linux.h @@ -26,11 +26,20 @@ extern "C" { #include <pthread.h> #include <sys/types.h> +/** The thread starting arguments */ +typedef struct { + void *(*start_routine) (void *); /**< The function to run */ + void *arg; /**< The functions arguemnts */ + +} odp_start_args_t; + /** Linux pthread state information */ typedef struct { pthread_t thread; /**< Pthread ID */ pthread_attr_t attr; /**< Pthread attributes */ int cpu; /**< CPU ID */ + /** Saved starting args for join to later free */ + odp_start_args_t *start_args; } odph_linux_pthread_t; |