diff options
Diffstat (limited to 'apps/codecs/libspeex/os_support.h')
-rw-r--r-- | apps/codecs/libspeex/os_support.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/codecs/libspeex/os_support.h b/apps/codecs/libspeex/os_support.h index 92262f1942..7e4b25b3d9 100644 --- a/apps/codecs/libspeex/os_support.h +++ b/apps/codecs/libspeex/os_support.h | |||
@@ -41,10 +41,14 @@ | |||
41 | #include <stdio.h> | 41 | #include <stdio.h> |
42 | #include <stdlib.h> | 42 | #include <stdlib.h> |
43 | 43 | ||
44 | /** Speex wrapper for calloc. To do your own dynamic allocation, all you need to do is replace this function, speex_realloc and speex_free */ | 44 | /** Speex wrapper for calloc. To do your own dynamic allocation, all you need to do is replace this function, speex_realloc and speex_free |
45 | NOTE: speex_alloc needs to CLEAR THE MEMORY */ | ||
45 | #ifndef OVERRIDE_SPEEX_ALLOC | 46 | #ifndef OVERRIDE_SPEEX_ALLOC |
46 | static inline void *speex_alloc (int size) | 47 | static inline void *speex_alloc (int size) |
47 | { | 48 | { |
49 | /* WARNING: this is not equivalent to malloc(). If you want to use malloc() | ||
50 | or your own allocator, YOU NEED TO CLEAR THE MEMORY ALLOCATED. Otherwise | ||
51 | you will experience strange bugs */ | ||
48 | return calloc(size,1); | 52 | return calloc(size,1); |
49 | } | 53 | } |
50 | #endif | 54 | #endif |
@@ -53,6 +57,7 @@ static inline void *speex_alloc (int size) | |||
53 | #ifndef OVERRIDE_SPEEX_ALLOC_SCRATCH | 57 | #ifndef OVERRIDE_SPEEX_ALLOC_SCRATCH |
54 | static inline void *speex_alloc_scratch (int size) | 58 | static inline void *speex_alloc_scratch (int size) |
55 | { | 59 | { |
60 | /* Scratch space doesn't need to be cleared */ | ||
56 | return calloc(size,1); | 61 | return calloc(size,1); |
57 | } | 62 | } |
58 | #endif | 63 | #endif |