Blender Git Loki

Git Commits -> Revision 9c9ea37

Revision 9c9ea37 by Jacques Lucke (master)
January 23, 2020, 13:21 (GMT)
Fix: Use a minimal alignment of 8 in MEM_lockfree_mallocN_aligned

`posix_memalign` requires the `alignment` to be at least `sizeof(void *)`.
Previously, `MEM_mallocN_aligned` would simply return `NULL` if a too small
`alignment` was used. This was an OS specific issue.

The solution is to use a minimal alignment of `8` for all aligned allocations.
The unit tests have been extended to test more possible alignments (some
of which were broken before).

Reviewers: brecht

Differential Revision: https://developer.blender.org/D6660

Commit Details:

Full Hash: 9c9ea37770dcf2d8a77cab0bf267a5bcf76500eb
Parent Commit: 237d03f
Lines Changed: +89, -15

4 Modified Paths:

/intern/guardedalloc/intern/mallocn.c (+3, -0) (Diff)
/intern/guardedalloc/intern/mallocn_intern.h (+2, -0) (Diff)
/intern/guardedalloc/intern/mallocn_lockfree_impl.c (+13, -10) (Diff)
/tests/gtests/guardedalloc/guardedalloc_alignment_test.cc (+71, -5) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021