[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47265] branches/soc-2011-tomato/source/ blender/blenkernel: use malloc for point arrays since they are filled in immediately.

Campbell Barton ideasman42 at gmail.com
Thu May 31 11:46:17 CEST 2012


Revision: 47265
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47265
Author:   campbellbarton
Date:     2012-05-31 09:46:17 +0000 (Thu, 31 May 2012)
Log Message:
-----------
use malloc for point arrays since they are filled in immediately.

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/blenkernel/BKE_mask.h
    branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c

Modified: branches/soc-2011-tomato/source/blender/blenkernel/BKE_mask.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/BKE_mask.h	2012-05-31 09:35:50 UTC (rev 47264)
+++ branches/soc-2011-tomato/source/blender/blenkernel/BKE_mask.h	2012-05-31 09:46:17 UTC (rev 47265)
@@ -57,6 +57,7 @@
 /* splines */
 struct MaskSpline *BKE_mask_spline_add(struct MaskObject *maskobj);
 int BKE_mask_spline_resolution(struct MaskSpline *spline);
+
 float (*BKE_mask_spline_differentiate(struct MaskSpline *spline, int *tot_diff_point))[2];
 float (*BKE_mask_spline_feather_differentiated_points(struct MaskSpline *spline, int *tot_feather_point))[2];
 float (*BKE_mask_spline_feather_points(struct MaskSpline *spline, int *tot_feather_point))[2];

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c	2012-05-31 09:35:50 UTC (rev 47264)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c	2012-05-31 09:46:17 UTC (rev 47265)
@@ -240,7 +240,7 @@
 
 	/* len+1 because of 'forward_diff_bezier' function */
 	*tot_diff_point = len;
-	diff_points = fp = MEM_callocN((len + 1) * sizeof(*diff_points), "mask spline vets");
+	diff_points = fp = MEM_mallocN((len + 1) * sizeof(*diff_points), "mask spline vets");
 
 	a = spline->tot_point - 1;
 	if (spline->flag & MASK_SPLINE_CYCLIC)
@@ -287,7 +287,7 @@
 	int i, j, tot, resol = BKE_mask_spline_feather_resolution(spline);
 
 	tot = resol * spline->tot_point;
-	feather = fp = MEM_callocN(tot * sizeof(*feather), "mask spline feather diff points");
+	feather = fp = MEM_mallocN(tot * sizeof(*feather), "mask spline feather diff points");
 
 	for (i = 0; i < spline->tot_point; i++) {
 		MaskSplinePoint *point = &points_array[i];
@@ -326,7 +326,7 @@
 	}
 
 	/* create data */
-	feather = fp = MEM_callocN(tot * sizeof(*feather), "mask spline feather points");
+	feather = fp = MEM_mallocN(tot * sizeof(*feather), "mask spline feather points");
 
 	for (i = 0; i < spline->tot_point; i++) {
 		MaskSplinePoint *point = &points_array[i];




More information about the Bf-blender-cvs mailing list