File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 7878#define OVERRIDE_SPEEX_ALLOC_SCRATCH
7979#define OVERRIDE_SPEEX_REALLOC
8080#define OVERRIDE_SPEEX_FREE
81+ #define OVERRIDE_SPEEX_FREE_SCRATCH
8182
8283/* Override debug/warning functions */
8384#define OVERRIDE_SPEEX_FATAL
Original file line number Diff line number Diff line change @@ -10,11 +10,13 @@ extern void *kernel_zalloc_check(size_t size);
1010extern void * kernel_realloc (void * ptr , size_t size );
1111extern void kernel_free (void * ptr );
1212
13+
1314/* Override memory allocation functions to use PebbleOS kernel functions */
14- static inline void * speex_alloc (int size ) { return kernel_zalloc_check (size ); }
15- static inline void * speex_alloc_scratch (int size ) { return kernel_zalloc_check (size ); }
16- static inline void * speex_realloc (void * ptr , int size ) { return kernel_realloc (ptr , size ); }
15+ static inline void * speex_alloc (int size ) { return kernel_zalloc_check (( size_t ) size ); }
16+ static inline void * speex_alloc_scratch (int size ) { return kernel_zalloc_check (( size_t ) size ); }
17+ static inline void * speex_realloc (void * ptr , int size ) { return kernel_realloc (ptr , ( size_t ) size ); }
1718static inline void speex_free (void * ptr ) { kernel_free (ptr ); }
19+ static inline void speex_free_scratch (void * ptr ) { kernel_free (ptr ); }
1820
1921/* Override debug/warning functions to be no-ops for embedded system */
2022static inline void _speex_fatal (const char * str , const char * file , int line ) { (void )str ; (void )file ; (void )line ; }
Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ def build(bld):
5252 'DISABLE_NOTIFICATIONS' , # Disable notification functions
5353 ]
5454
55+ # Define stack sizes for encoder and decoder
56+ speex_defines += [
57+ 'NB_ENC_STACK=(2000*sizeof(spx_sig_t))' , # ~8 KiB
58+ 'NB_DEC_STACK=(1500*sizeof(spx_sig_t))' , # ~6 KiB
59+ ]
60+
5561 # Compiler flags to handle warnings
5662 speex_cflags = [
5763 '-Wno-implicit-function-declaration' ,
You can’t perform that action at this time.
0 commit comments