diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-03 21:53:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-03 21:53:41 +0400 |
commit | 2a8d76d7342b0064284075bb5b88d964eda32e87 (patch) | |
tree | 80ddb787fb51929ab80b9863710cb1a19ce27cb9 /source/blender/blenkernel/intern/fmodifier.c | |
parent | 5f72462e38e940a0e1e03ee682d159c1aabbc309 (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/blender/blenkernel/intern/fmodifier.c')
-rw-r--r-- | source/blender/blenkernel/intern/fmodifier.c | 18 |
1 files changed, 6 insertions, 12 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; |