From eda44fbc22d14b8eca987e206f467216159e2e43 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 28 Sep 2011 18:46:09 +0200 Subject: [PATCH] memory: fix memory alignment Fix compilation when POSIX_MEMALIGN is not set. Debug the configured alignment. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=660300 --- gst/gstmemory.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gst/gstmemory.c b/gst/gstmemory.c index 7222151fb7..ebaefc3a42 100644 --- a/gst/gstmemory.c +++ b/gst/gstmemory.c @@ -65,10 +65,10 @@ /* buffer alignment in bytes - 1 * an alignment of 7 would be the same as malloc() guarantees */ -#ifdef HAVE_POSIX_MEMALIGN #if defined(MEMORY_ALIGNMENT_MALLOC) size_t gst_memory_alignment = 7; #elif defined(MEMORY_ALIGNMENT_PAGESIZE) +/* we fill this in in the _init method */ size_t gst_memory_alignment = 0; #elif defined(MEMORY_ALIGNMENT) size_t gst_memory_alignment = MEMORY_ALIGNMENT - 1; @@ -76,7 +76,6 @@ size_t gst_memory_alignment = MEMORY_ALIGNMENT - 1; #error "No memory alignment configured" size_t gst_memory_alignment = 0; #endif -#endif /* HAVE_POSIX_MEMALIGN */ struct _GstAllocator { @@ -330,6 +329,8 @@ _priv_gst_memory_initialize (void) #endif #endif + GST_DEBUG ("memory alignment: %" G_GSIZE_FORMAT, gst_memory_alignment); + _default_mem_impl = gst_allocator_register (GST_ALLOCATOR_SYSMEM, &_mem_info); _default_allocator = _default_mem_impl;