Blender Git Commit Log

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)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021