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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-08-03 21:53:41 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-08-03 21:53:41 +0400
commit2a8d76d7342b0064284075bb5b88d964eda32e87 (patch)
tree80ddb787fb51929ab80b9863710cb1a19ce27cb9 /source
parent5f72462e38e940a0e1e03ee682d159c1aabbc309 (diff)
add versions of MEM_reallocN, MEM_recallocN which take a string arg so new allocs have an ID, changing existing functions signatures would be too disruptive at the moment.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c18
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c8
2 files changed, 9 insertions, 17 deletions
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index 915c75a0e7f..e0b4f94f0b7 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -144,12 +144,9 @@ static void fcm_generator_verify(FModifier *fcm)
const int arraysize_new = data->poly_order + 1;
/* arraysize needs to be order+1, so resize if not */
if (data->arraysize != arraysize_new) {
- if (data->coefficients) {
- data->coefficients = MEM_recallocN(data->coefficients, sizeof(float) * arraysize_new);
- }
- else {
- data->coefficients = MEM_callocN(sizeof(float) * arraysize_new, "FMod_Generator_Coefs");
- }
+ data->coefficients = MEM_recallocN_id(data->coefficients,
+ sizeof(float) * arraysize_new,
+ "FMod_Generator_Coefs");
data->arraysize = arraysize_new;
}
break;
@@ -159,12 +156,9 @@ static void fcm_generator_verify(FModifier *fcm)
const int arraysize_new = data->poly_order * 2;
/* arraysize needs to be (2 * order), so resize if not */
if (data->arraysize != arraysize_new) {
- if (data->coefficients) {
- data->coefficients = MEM_recallocN(data->coefficients, sizeof(float) * arraysize_new);
- }
- else {
- data->coefficients = MEM_callocN(sizeof(float) * arraysize_new, "FMod_Generator_Coefs");
- }
+ data->coefficients = MEM_recallocN_id(data->coefficients,
+ sizeof(float) * arraysize_new,
+ "FMod_Generator_Coefs");
data->arraysize = arraysize_new;
}
break;
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index efe6c08cafe..439bc51896f 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -118,11 +118,9 @@ static void rna_GPencilLayer_info_set(PointerRNA *ptr, const char *value)
static void rna_GPencil_stroke_point_add(bGPDstroke *stroke, int count)
{
if (count > 0) {
- if (stroke->points == NULL)
- stroke->points = MEM_callocN(sizeof(bGPDspoint) * count, "gp_stroke_points");
- else
- stroke->points = MEM_recallocN(stroke->points, sizeof(bGPDspoint) * (stroke->totpoints + count));
-
+ stroke->points = MEM_recallocN_id(stroke->points,
+ sizeof(bGPDspoint) * (stroke->totpoints + count),
+ "gp_stroke_points");
stroke->totpoints += count;
}
}