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
26 26
27void tBuffer_init (tBuffer* const sb, uint32_t length)27void tBuffer_init (tBuffer* const sb, uint32_t length)
28{28{
29 _tBuffer* s = *sb = (_tBuffer*) leaf_alloc(sizeof(_tBuffer));29 tBuffer_initToPool(sb, length, &leaf_mempool);
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;
38}30}
39 31
40void tBuffer_free (tBuffer* const sb)32void tBuffer_free (tBuffer* const sb)
41{33{
42 _tBuffer* s = *sb;34 tBuffer_freeFromPool(sb, &leaf_mempool);
43
44 leaf_free(s->buff);
45 leaf_free(s);
46}35}
47 36
48void tBuffer_initToPool (tBuffer* const sb, uint32_t length, tMempool* const mp)37void 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
54 43
55 s->bufferLength = length;44 s->bufferLength = length;
56 s->recordedLength = 0;45 s->recordedLength = 0;
46 s->active = 0;
57 s->idx = 0;47 s->idx = 0;
58 s->mode = RecordOneShot;48 s->mode = RecordOneShot;
59}49}

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