diff options
| author | Jason Evans <je@fb.com> | 2011-03-02 20:19:58 (GMT) |
|---|---|---|
| committer | Jason Evans <je@fb.com> | 2011-03-02 20:19:58 (GMT) |
| commit | e27d134efc8609e3f95e4ec13f605ddcb5eb6ca6 (patch) | |
| tree | 42c7835f25258ae9bf251bb1f5b9c29d46ca6a63 /jemalloc/src/jemalloc.c | |
| parent | a73ebd946ab00cacf9bbad6a5edf6aea50c18c0f (diff) | |
| parent | 6e56e5ec6a246c313e44cee0df9fd60483436cfd (diff) | |
| download | jemalloc-2.1.2.zip jemalloc-2.1.2.tar.gz jemalloc-2.1.2.tar.bz2 | |
Merge branch 'dev'2.1.2
Diffstat (limited to 'jemalloc/src/jemalloc.c')
| -rw-r--r-- | jemalloc/src/jemalloc.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/jemalloc/src/jemalloc.c b/jemalloc/src/jemalloc.c index f5434c7..61a36c7 100644 --- a/jemalloc/src/jemalloc.c +++ b/jemalloc/src/jemalloc.c @@ -213,6 +213,28 @@ stats_print_atexit(void) JEMALLOC_P(malloc_stats_print)(NULL, NULL, NULL); } +#if (defined(JEMALLOC_STATS) && defined(NO_TLS)) +thread_allocated_t * +thread_allocated_get_hard(void) +{ + thread_allocated_t *thread_allocated = (thread_allocated_t *) + imalloc(sizeof(thread_allocated_t)); + if (thread_allocated == NULL) { + static thread_allocated_t static_thread_allocated = {0, 0}; + malloc_write("<jemalloc>: Error allocating TSD;" + " mallctl(\"thread.{de,}allocated[p]\", ...)" + " will be inaccurate\n"); + if (opt_abort) + abort(); + return (&static_thread_allocated); + } + pthread_setspecific(thread_allocated_tsd, thread_allocated); + thread_allocated->allocated = 0; + thread_allocated->deallocated = 0; + return (thread_allocated); +} +#endif + /* * End miscellaneous support functions. */ |
