=bmesh= merge from trunk at r36529
[blender.git] / source / blender / blenkernel / intern / deform.c
index 0696653d2e4c2c065168153d1fc283fa7b649ef5..0c4d1d067e6a1ae19e49b017b0cda473a2874476 100644 (file)
@@ -49,6 +49,7 @@
 #include "BKE_deform.h"
 
 #include "BLI_blenlib.h"
+#include "BLI_cellalloc.h"
 
 
 void defgroup_copy_list (ListBase *outbase, ListBase *inbase)
@@ -89,10 +90,10 @@ void defvert_copy (MDeformVert *dvert_r, const MDeformVert *dvert)
        }
        else {
                if(dvert_r->dw)
-                       MEM_freeN(dvert_r->dw);
+                       BLI_cellalloc_free(dvert_r->dw);
 
                if(dvert->totweight)
-                       dvert_r->dw= MEM_dupallocN(dvert->dw);
+                       dvert_r->dw= BLI_cellalloc_dupalloc(dvert->dw);
                else
                        dvert_r->dw= NULL;
 
@@ -496,10 +497,10 @@ MDeformWeight *defvert_verify_index(MDeformVert *dv, const int defgroup)
        if(newdw)
                return newdw;
 
-       newdw = MEM_callocN(sizeof(MDeformWeight)*(dv->totweight+1), "deformWeight");
+       newdw = BLI_cellalloc_calloc(sizeof(MDeformWeight)*(dv->totweight+1), "deformWeight");
        if(dv->dw) {
                memcpy(newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight);
-               MEM_freeN(dv->dw);
+               BLI_cellalloc_free(dv->dw);
        }
        dv->dw=newdw;