[vlc-devel] commit: block_Realloc: turn off posix_memalign() use ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Sep 29 21:36:03 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Sep 29 22:35:27 2009 +0300| [609b2216b39648aca18b1867dffa2710d6655257] | committer: Rémi Denis-Courmont 

block_Realloc: turn off posix_memalign() use

This is significantly slower than malloc().

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=609b2216b39648aca18b1867dffa2710d6655257
---

 src/misc/block.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/misc/block.c b/src/misc/block.c
index 3a673f5..ecc0c58 100644
--- a/src/misc/block.c
+++ b/src/misc/block.c
@@ -104,7 +104,9 @@ block_t *block_Alloc( size_t i_size )
     uint8_t *buf;
 
 #define ALIGN(x) (((x) + BLOCK_ALIGN - 1) & ~(BLOCK_ALIGN - 1))
-#ifdef HAVE_POSIX_MEMALIGN
+#if 0 /*def HAVE_POSIX_MEMALIGN */
+    /* posix_memalign(,16,) is much slower than malloc() on glibc.
+     * -- Courmisch, September 2009, glibc 2.5 & 2.9 */
     const size_t i_alloc = ALIGN(sizeof(*p_sys)) + (2 * BLOCK_PADDING)
                          + ALIGN(i_size);
     void *ptr;




More information about the vlc-devel mailing list