ref: d0fbdd5916dbf269d35008a3414263c34bcf3d35
parent: 8e6e59716b25624b726ee8f2c4bd50c6d3328c08
author: mulshine <mulshine@princeton.edu>
date: Wed Jan 30 14:01:59 EST 2019
Updated leaf for sampling on h7.
--- a/LEAF/Inc/leaf-mempool.h
+++ b/LEAF/Inc/leaf-mempool.h
@@ -50,7 +50,7 @@
//==============================================================================
-#define MPOOL_POOL_SIZE 1000000
+#define MPOOL_POOL_SIZE 500000
#define MPOOL_ALIGN_SIZE (8)
//#define size_t unsigned long
@@ -91,6 +91,8 @@
size_t leaf_pool_get_used(void);
void* leaf_pool_get_pool(void);
+
+void leaf_mempool_overrun(void);
//==============================================================================
--- a/LEAF/Inc/leaf-sample.h
+++ b/LEAF/Inc/leaf-sample.h
@@ -64,7 +64,7 @@
Normal,
Loop,
BackAndForth,
- ModeNil
+ SampleModeNil
} Mode;
typedef struct _tSamplePlayer
--- a/LEAF/Src/leaf-mempool.c
+++ b/LEAF/Src/leaf-mempool.c
@@ -121,7 +121,11 @@
void* leaf_alloc(size_t size)
{
- return mpool_alloc(size, &leaf_pool);
+ void* block = mpool_alloc(size, &leaf_pool);
+
+ if (block == NULL) leaf_mempool_overrun();
+
+ return block;
}
void mpool_free(void* ptr, mpool_t* pool)
@@ -189,5 +193,10 @@
*/
static inline size_t mpool_align(size_t size) {
return (size + (MPOOL_ALIGN_SIZE - 1)) & ~(MPOOL_ALIGN_SIZE - 1);
+}
+
+void leaf_mempool_overrun(void)
+{
+
}