MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / realloc

Method realloc

DSView/pv/data/mathstack.cpp:141–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141void MathStack::realloc(uint64_t num)
142{
143 if (num != _total_sample_num) {
144 free_envelop();
145 _total_sample_num = num;
146
147 _math.resize(_total_sample_num);
148 uint64_t envelop_count = _total_sample_num / EnvelopeScaleFactor;
149 for (unsigned int level = 0; level < ScaleStepCount; level++) {
150 envelop_count = ((envelop_count + EnvelopeDataUnit - 1) /
151 EnvelopeDataUnit) * EnvelopeDataUnit;
152 _envelope_level[level].samples = (EnvelopeSample*)malloc(envelop_count * sizeof(EnvelopeSample));
153 envelop_count = envelop_count / EnvelopeScaleFactor;
154 }
155 }
156}
157
158void MathStack::enable_envelope(bool enable)
159{

Callers 2

feed_in_dsoMethod · 0.80
math_rebuildMethod · 0.80

Calls 1

resizeMethod · 0.45

Tested by

no test coverage detected