mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-25 08:33:38 +03:00
Fix a strict aliasing violation.
This commit is contained in:
parent
828d919b5e
commit
56af64dc19
1 changed files with 6 additions and 1 deletions
|
|
@ -89,7 +89,12 @@ chunk_hooks_set(arena_t *arena, const chunk_hooks_t *chunk_hooks)
|
||||||
* correctness, so they perform unlocked reads.
|
* correctness, so they perform unlocked reads.
|
||||||
*/
|
*/
|
||||||
#define ATOMIC_COPY_HOOK(n) do { \
|
#define ATOMIC_COPY_HOOK(n) do { \
|
||||||
atomic_write_p((void **)&arena->chunk_hooks.n, chunk_hooks->n); \
|
union { \
|
||||||
|
chunk_##n##_t **n; \
|
||||||
|
void **v; \
|
||||||
|
} u; \
|
||||||
|
u.n = &arena->chunk_hooks.n; \
|
||||||
|
atomic_write_p(u.v, chunk_hooks->n); \
|
||||||
} while (0)
|
} while (0)
|
||||||
ATOMIC_COPY_HOOK(alloc);
|
ATOMIC_COPY_HOOK(alloc);
|
||||||
ATOMIC_COPY_HOOK(dalloc);
|
ATOMIC_COPY_HOOK(dalloc);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue