diff options
| author | Jason Evans <jasone@canonware.com> | 2016-05-24 21:13:36 -0700 |
|---|---|---|
| committer | Jason Evans <jasone@canonware.com> | 2016-06-03 12:27:41 -0700 |
| commit | 23c52c895f96c1dc2492855438fde04d9a10869e (patch) | |
| tree | bae1b813fa5f246f19b3fe904cfcc9b272c72a08 /include/jemalloc | |
| parent | 760bf11b23b96a9c26e48ca51df9644bb382892f (diff) | |
| download | platform_external_jemalloc_new-23c52c895f96c1dc2492855438fde04d9a10869e.tar.gz platform_external_jemalloc_new-23c52c895f96c1dc2492855438fde04d9a10869e.tar.bz2 platform_external_jemalloc_new-23c52c895f96c1dc2492855438fde04d9a10869e.zip | |
Make extent_prof_tctx_[gs]et() atomic.
Diffstat (limited to 'include/jemalloc')
| -rw-r--r-- | include/jemalloc/internal/extent.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/jemalloc/internal/extent.h b/include/jemalloc/internal/extent.h index a286fa9a..c3bdacb4 100644 --- a/include/jemalloc/internal/extent.h +++ b/include/jemalloc/internal/extent.h @@ -45,7 +45,10 @@ struct extent_s { bool e_slab; /* Profile counters, used for huge objects. */ - prof_tctx_t *e_prof_tctx; + union { + void *e_prof_tctx_pun; + prof_tctx_t *e_prof_tctx; + }; /* Linkage for arena's runs_dirty and chunks_cache rings. */ arena_runs_dirty_link_t rd; @@ -187,7 +190,8 @@ JEMALLOC_INLINE prof_tctx_t * extent_prof_tctx_get(const extent_t *extent) { - return (extent->e_prof_tctx); + return ((prof_tctx_t *)atomic_read_p( + &((extent_t *)extent)->e_prof_tctx_pun)); } JEMALLOC_INLINE void @@ -250,7 +254,7 @@ JEMALLOC_INLINE void extent_prof_tctx_set(extent_t *extent, prof_tctx_t *tctx) { - extent->e_prof_tctx = tctx; + atomic_write_p(&extent->e_prof_tctx_pun, tctx); } JEMALLOC_INLINE void |
