@@ -64,8 +64,7 @@ C_OUTLINE::C_OUTLINE(CRACKEDGE* startpt, ICOORD bot_left, ICOORD top_right,
64
64
return ;
65
65
}
66
66
// get memory
67
- steps = (uint8_t *) alloc_mem (step_mem ());
68
- memset (steps, 0 , step_mem ());
67
+ steps = (uint8_t *)calloc (step_mem (), 1 );
69
68
edgept = startpt;
70
69
71
70
for (stepindex = 0 ; stepindex < length; stepindex++) {
@@ -98,8 +97,7 @@ int16_t length //length of loop
98
97
pos = startpt;
99
98
stepcount = length; // No. of steps.
100
99
ASSERT_HOST (length >= 0 );
101
- steps = static_cast <uint8_t *>(alloc_mem (step_mem ())); // Get memory.
102
- memset (steps, 0 , step_mem ());
100
+ steps = static_cast <uint8_t *>(calloc (step_mem (), 1 )); // Get memory.
103
101
104
102
lastdir = new_steps[length - 1 ];
105
103
prevdir = lastdir;
@@ -162,8 +160,7 @@ C_OUTLINE::C_OUTLINE(C_OUTLINE* srcline, FCOORD rotation) : offsets(nullptr) {
162
160
return ;
163
161
}
164
162
// get memory
165
- steps = (uint8_t *) alloc_mem (step_mem ());
166
- memset (steps, 0 , step_mem ());
163
+ steps = (uint8_t *)calloc (step_mem (), 1 );
167
164
168
165
for (int iteration = 0 ; iteration < 2 ; ++iteration) {
169
166
DIR128 round1 = iteration == 0 ? 32 : 0 ;
@@ -1014,10 +1011,9 @@ void C_OUTLINE::plot_normed(const DENORM& denorm, ScrollView::Color colour,
1014
1011
C_OUTLINE& C_OUTLINE::operator =(const C_OUTLINE& source) {
1015
1012
box = source.box ;
1016
1013
start = source.start ;
1017
- if (steps != nullptr )
1018
- free_mem (steps);
1014
+ free (steps);
1019
1015
stepcount = source.stepcount ;
1020
- steps = (uint8_t *) alloc_mem (step_mem ());
1016
+ steps = (uint8_t *)malloc (step_mem ());
1021
1017
memmove (steps, source.steps , step_mem ());
1022
1018
if (!children.empty ())
1023
1019
children.clear ();
0 commit comments