aboutsummaryrefslogtreecommitdiffstats
path: root/include/jemalloc/internal/tsd.h
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2012-04-18 18:29:49 +0200
committerJason Evans <jasone@canonware.com>2012-04-18 19:25:01 -0700
commit13067ec8350f213c3accc2e5fb70ca5a503e0e17 (patch)
tree97d4337aebf27096bfbb1f0b3fbe234e845ac106 /include/jemalloc/internal/tsd.h
parent8ad483fe60a803acdbd403d88bb30b548ee1b5f9 (diff)
downloadplatform_external_jemalloc_new-13067ec8350f213c3accc2e5fb70ca5a503e0e17.tar.gz
platform_external_jemalloc_new-13067ec8350f213c3accc2e5fb70ca5a503e0e17.tar.bz2
platform_external_jemalloc_new-13067ec8350f213c3accc2e5fb70ca5a503e0e17.zip
Remove extra argument for malloc_tsd_cleanup_register
Bookkeeping an extra argument that actually only stores a function pointer for a function we already have is not very useful.
Diffstat (limited to 'include/jemalloc/internal/tsd.h')
-rw-r--r--include/jemalloc/internal/tsd.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/include/jemalloc/internal/tsd.h b/include/jemalloc/internal/tsd.h
index 5888b377..5e904cbb 100644
--- a/include/jemalloc/internal/tsd.h
+++ b/include/jemalloc/internal/tsd.h
@@ -4,11 +4,7 @@
/* Maximum number of malloc_tsd users with cleanup functions. */
#define MALLOC_TSD_CLEANUPS_MAX 8
-typedef struct malloc_tsd_cleanup_s malloc_tsd_cleanup_t;
-struct malloc_tsd_cleanup_s {
- bool (*f)(void *);
- void *arg;
-};
+typedef bool (*malloc_tsd_cleanup_t)(void);
/*
* TLS/TSD-agnostic macro-based implementation of thread-specific data. There
@@ -110,13 +106,12 @@ a_attr bool a_name##_booted = false;
a_cleanup) \
/* Initialization/cleanup. */ \
a_attr bool \
-a_name##_tsd_cleanup_wrapper(void *arg) \
+a_name##_tsd_cleanup_wrapper(void) \
{ \
- bool (*cleanup)(void *) = arg; \
\
if (a_name##_initialized) { \
a_name##_initialized = false; \
- cleanup(&a_name##_tls); \
+ a_cleanup(&a_name##_tls); \
} \
return (a_name##_initialized); \
} \
@@ -126,7 +121,7 @@ a_name##_tsd_boot(void) \
\
if (a_cleanup != malloc_tsd_no_cleanup) { \
malloc_tsd_cleanup_register( \
- &a_name##_tsd_cleanup_wrapper, a_cleanup); \
+ &a_name##_tsd_cleanup_wrapper); \
} \
a_name##_booted = true; \
return (false); \
@@ -290,7 +285,7 @@ a_name##_tsd_set(a_type *val) \
void *malloc_tsd_malloc(size_t size);
void malloc_tsd_dalloc(void *wrapper);
void malloc_tsd_no_cleanup(void *);
-void malloc_tsd_cleanup_register(bool (*f)(void *), void *arg);
+void malloc_tsd_cleanup_register(bool (*f)(void));
void malloc_tsd_boot(void);
#endif /* JEMALLOC_H_EXTERNS */