History

minor

Matthew Wang committed 6 years ago

Commit 2724ecf1 parent 44000f71 file · +3 −13Browse files

Unified · Split

LEAF/Src/leaf-sampling.c+3−13
@@ -26,23 +26,12 @@ · 25 unmodified lines
2626
2727 void tBuffer_init (tBuffer* const sb, uint32_t length)
2828 {
29− _tBuffer* s = *sb = (_tBuffer*) leaf_alloc(sizeof(_tBuffer));
30−
31− s->buff = (float*) leaf_alloc( sizeof(float) * length);
32−
33− s->bufferLength = length;
34− s->recordedLength = 0;
35− s->active = 0;
36− s->idx = 0;
37− s->mode = RecordOneShot;
29+ tBuffer_initToPool(sb, length, &leaf_mempool);
3830 }
3931
4032 void tBuffer_free (tBuffer* const sb)
4133 {
42− _tBuffer* s = *sb;
43−
44− leaf_free(s->buff);
45− leaf_free(s);
34+ tBuffer_freeFromPool(sb, &leaf_mempool);
4635 }
4736
4837 void tBuffer_initToPool (tBuffer* const sb, uint32_t length, tMempool* const mp)
@@ -54,6 +43,7 @@ void tBuffer_initToPool (tBuffer* const sb, uint32_t length, tMempool* const mp · 5 unmodified lines
5443
5544 s->bufferLength = length;
5645 s->recordedLength = 0;
46+ s->active = 0;
5747 s->idx = 0;
5848 s->mode = RecordOneShot;
5949 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t