Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-09-15 09:17:19 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-09-15 09:17:19 +0400
commit3403b7db8d579e013104ae65729fb006eb3bb195 (patch)
tree0426dc442abc26d4aa6e27624a413e3088668139 /source/blender/blenkernel/intern/customdata.c
parent9f741348621a371201e9ab7a1d5c63ff1b1b9a27 (diff)
use stack memory for deform weight interpolation.
Diffstat (limited to 'source/blender/blenkernel/intern/customdata.c')
-rw-r--r--source/blender/blenkernel/intern/customdata.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 1188c1b7f4a..03dfee4b57c 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -45,11 +45,12 @@
#include "DNA_ID.h"
#include "BLI_utildefines.h"
-#include "BLI_blenlib.h"
-#include "BLI_linklist.h"
+#include "BLI_string.h"
+#include "BLI_path_util.h"
#include "BLI_math.h"
#include "BLI_mempool.h"
#include "BLI_utildefines.h"
+#include "BLI_alloca.h"
#include "BLF_translation.h"
@@ -256,7 +257,7 @@ static void layerInterp_mdeformvert(void **sources, const float *weights,
/* if this def_nr is not in the list, add it */
if (!node) {
- struct MDeformWeight_Link *tmp_dwlink = MEM_mallocN(sizeof(*tmp_dwlink), __func__);
+ struct MDeformWeight_Link *tmp_dwlink = alloca(sizeof(*tmp_dwlink));
tmp_dwlink->dw.def_nr = dw->def_nr;
tmp_dwlink->dw.weight = weight;
@@ -286,12 +287,9 @@ static void layerInterp_mdeformvert(void **sources, const float *weights,
}
if (totweight) {
- struct MDeformWeight_Link *node_next;
dvert->totweight = totweight;
- for (i = 0, node = dest_dwlink; node; node = node_next, i++) {
- node_next = node->next;
+ for (i = 0, node = dest_dwlink; node; node = node->next, i++) {
dvert->dw[i] = node->dw;
- MEM_freeN(node);
}
}
else {