|
90 | 90 | #include <setjmp.h> |
91 | 91 |
|
92 | 92 | #include <pocketsphinx/prim_type.h> |
| 93 | +#include <pocketsphinx/export.h> |
| 94 | + |
93 | 95 |
|
94 | 96 | /** \file ckd_alloc.h |
95 | 97 | *\brief Sphinx's memory allocation/deallocation routines. |
@@ -136,27 +138,31 @@ void ckd_fail(char *format, ...); |
136 | 138 | * message if any error occurs, with any other behaviour determined by |
137 | 139 | * ckd_set_jump(), above. |
138 | 140 | */ |
139 | | - |
| 141 | +POCKETSPHINX_EXPORT |
140 | 142 | void *__ckd_calloc__(size_t n_elem, size_t elem_size, |
141 | 143 | const char *caller_file, int caller_line); |
142 | 144 |
|
| 145 | +POCKETSPHINX_EXPORT |
143 | 146 | void *__ckd_malloc__(size_t size, |
144 | 147 | const char *caller_file, int caller_line); |
145 | 148 |
|
| 149 | +POCKETSPHINX_EXPORT |
146 | 150 | void *__ckd_realloc__(void *ptr, size_t new_size, |
147 | 151 | const char *caller_file, int caller_line); |
148 | 152 |
|
149 | 153 | /** |
150 | 154 | * Like strdup, except that if an error occurs it prints a diagnostic message and |
151 | 155 | * exits. If origin in NULL the function also returns NULL. |
152 | 156 | */ |
| 157 | +POCKETSPHINX_EXPORT |
153 | 158 | char *__ckd_salloc__(const char *origstr, |
154 | 159 | const char *caller_file, int caller_line); |
155 | 160 |
|
156 | 161 | /** |
157 | 162 | * Allocate a 2-D array and return ptr to it (ie, ptr to vector of ptrs). |
158 | 163 | * The data area is allocated in one block so it can also be treated as a 1-D array. |
159 | 164 | */ |
| 165 | +POCKETSPHINX_EXPORT |
160 | 166 | void *__ckd_calloc_2d__(size_t d1, size_t d2, /* In: #elements in the 2 dimensions */ |
161 | 167 | size_t elemsize, /* In: Size (#bytes) of each element */ |
162 | 168 | const char *caller_file, int caller_line); /* In */ |
@@ -205,11 +211,13 @@ void *__ckd_alloc_2d_ptr(size_t d1, |
205 | 211 | /** |
206 | 212 | * Test and free a 1-D array |
207 | 213 | */ |
| 214 | +POCKETSPHINX_EXPORT |
208 | 215 | void ckd_free(void *ptr); |
209 | 216 |
|
210 | 217 | /** |
211 | 218 | * Free a 2-D array (ptr) previously allocated by ckd_calloc_2d |
212 | 219 | */ |
| 220 | +POCKETSPHINX_EXPORT |
213 | 221 | void ckd_free_2d(void *ptr); |
214 | 222 |
|
215 | 223 | /** |
|
0 commit comments