0
0
forked from blender/blender
blender/intern/guardedalloc
Jacques Lucke 8ea425d95d Fix #118402: enforce expected minimum alignment in MEM_CXX_CLASS_ALLOC_FUNCS
This `operator new` added in ecc3e78d78
are only called if the alignment is greater than `__STDCPP_DEFAULT_NEW_ALIGNMENT__`.
This is generally 8 or 16 depending on the platform. `MEM_mallocN` does
guarantee 16 byte alignment currently (in fact it's usually not 16 byte aligned
because of `MemHead`). Now `MEM_mallocN_aligned` is used with the default
alignment, even if we don't know that the type does not require it.

An alternative would be to pass the alignment to `MEM_CXX_CLASS_ALLOC_FUNCS`,
but that would be more intrusive.

Pull Request: blender/blender#118568
2024-02-21 18:14:11 +01:00
..
cpp Cleanup: use braces around statements 2023-09-12 14:48:20 +10:00
intern Cleanup: Make format 2024-01-16 10:56:55 -05:00
test/simpletest Cleanup: use braces around statements 2023-09-12 14:48:20 +10:00
tests License Headers: Set copyright to "Blender Authors", add AUTHORS 2023-08-16 00:20:26 +10:00
CMakeLists.txt Tests: add option to build one binary per GTest file 2024-01-03 18:35:50 +01:00
MEM_guardedalloc.h Fix #118402: enforce expected minimum alignment in MEM_CXX_CLASS_ALLOC_FUNCS 2024-02-21 18:14:11 +01:00