History

Updated leaf for sampling on h7.

mulshine committed 7 years ago

Commit d0fbdd51 parent 8e6e5973 files · +14 −3Browse files

Unified · Split

3 files
  1. LEAF/Inc/leaf-mempool.h +3 −1
  2. LEAF/Inc/leaf-sample.h +1 −1
  3. LEAF/Src/leaf-mempool.c +10 −1
LEAF/Inc/leaf-mempool.h+3−1
@@ -50,7 +50,7 @@ extern "C" { · 49 unmodified lines
5050
5151 //==============================================================================
5252
53−#define MPOOL_POOL_SIZE 1000000
53+#define MPOOL_POOL_SIZE 500000
5454 #define MPOOL_ALIGN_SIZE (8)
5555
5656 //#define size_t unsigned long
@@ -91,6 +91,8 @@ size_t leaf_pool_get_size(void); · 34 unmodified lines
9191 size_t leaf_pool_get_used(void);
9292
9393 void* leaf_pool_get_pool(void);
94+
95+void leaf_mempool_overrun(void);
9496
9597 //==============================================================================
9698
LEAF/Inc/leaf-sample.h+1−1
@@ -64,7 +64,7 @@ extern "C" { · 63 unmodified lines
6464 Normal,
6565 Loop,
6666 BackAndForth,
67− ModeNil
67+ SampleModeNil
6868 } Mode;
6969
7070 typedef struct _tSamplePlayer
LEAF/Src/leaf-mempool.c+10−1
@@ -121,7 +121,11 @@ void* mpool_alloc(size_t size, mpool_t* pool) · 120 unmodified lines
121121
122122 void* leaf_alloc(size_t size)
123123 {
124− return mpool_alloc(size, &leaf_pool);
124+ void* block = mpool_alloc(size, &leaf_pool);
125+
126+ if (block == NULL) leaf_mempool_overrun();
127+
128+ return block;
125129 }
126130
127131 void mpool_free(void* ptr, mpool_t* pool)
@@ -191,3 +195,8 @@ static inline size_t mpool_align(size_t size) { · 63 unmodified lines
191195 return (size + (MPOOL_ALIGN_SIZE - 1)) & ~(MPOOL_ALIGN_SIZE - 1);
192196 }
193197
198+void leaf_mempool_overrun(void)
199+{
200+
201+}
202+

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