pcm_buffer: un-inline pcm_buffer_get()

This method is too complex for inlining.
This commit is contained in:
Max Kellermann
2011-11-27 19:54:09 +01:00
parent cd108ba3aa
commit f5f1bfbef1
3 changed files with 46 additions and 15 deletions

View File

@@ -58,19 +58,8 @@ pcm_buffer_deinit(struct pcm_buffer *buffer)
* Get the buffer, and guarantee a minimum size. This buffer becomes
* invalid with the next pcm_buffer_get() call.
*/
static inline void *
pcm_buffer_get(struct pcm_buffer *buffer, size_t size)
{
if (buffer->size < size) {
/* free the old buffer */
g_free(buffer->buffer);
/* allocate a new buffer; align at 8 kB boundaries */
buffer->size = ((size - 1) | 0x1fff) + 1;
buffer->buffer = g_malloc(buffer->size);
}
return buffer->buffer;
}
G_GNUC_MALLOC
void *
pcm_buffer_get(struct pcm_buffer *buffer, size_t size);
#endif