summaryrefslogtreecommitdiff
path: root/lib/rbcodec/rbcodecplatform-unix.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/rbcodecplatform-unix.h')
-rw-r--r--lib/rbcodec/rbcodecplatform-unix.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/rbcodec/rbcodecplatform-unix.h b/lib/rbcodec/rbcodecplatform-unix.h
index c9c8a29642..5e65be3ae4 100644
--- a/lib/rbcodec/rbcodecplatform-unix.h
+++ b/lib/rbcodec/rbcodecplatform-unix.h
@@ -74,4 +74,27 @@ static inline off_t filesize(int fd) {
74#endif 74#endif
75#endif 75#endif
76*/ 76*/
77
78static inline bool tdspeed_alloc_buffers(int32_t **buffers,
79 const int *buf_s, int nbuf)
80{
81 int i;
82 for (i = 0; i < nbuf; i++)
83 {
84 buffers[i] = malloc(buf_s[i]);
85 if (!buffers[i])
86 return false;
87 }
88 return true;
89}
90
91static inline void tdspeed_free_buffers(int32_t **buffers, int nbuf)
92{
93 int i;
94 for (i = 0; i < nbuf; i++)
95 {
96 free(buffers[i]);
97 }
98}
99
77#endif 100#endif