[Bf-blender-cvs] [2f91feeb036] functions: allocate attributes at 64 byte aligned addresses
Jacques Lucke
noreply at git.blender.org
Sun Jun 30 16:00:42 CEST 2019
Commit: 2f91feeb036a1e5092bb2a50ffbe2c9096aca009
Author: Jacques Lucke
Date: Sun Jun 30 10:37:49 2019 +0200
Branches: functions
https://developer.blender.org/rB2f91feeb036a1e5092bb2a50ffbe2c9096aca009
allocate attributes at 64 byte aligned addresses
===================================================================
M source/blender/simulations/bparticles/attributes.cpp
===================================================================
diff --git a/source/blender/simulations/bparticles/attributes.cpp b/source/blender/simulations/bparticles/attributes.cpp
index 914bb38db02..229ca4585c4 100644
--- a/source/blender/simulations/bparticles/attributes.cpp
+++ b/source/blender/simulations/bparticles/attributes.cpp
@@ -40,7 +40,9 @@ AttributeArraysCore AttributeArraysCore::NewWithSeparateAllocations(AttributesIn
{
SmallVector<void *> arrays;
for (AttributeType type : info.types()) {
- arrays.append(MEM_malloc_arrayN(size, size_of_attribute_type(type), __func__));
+ uint bytes_size = size * size_of_attribute_type(type);
+ void *ptr = MEM_mallocN_aligned(bytes_size, 64, __func__);
+ arrays.append(ptr);
}
return AttributeArraysCore(info, arrays, size);
}
More information about the Bf-blender-cvs
mailing list