Browse Source

mem: minor simplification of the alignment hack code

Idea-by: wanzhang
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.1
Michael Niedermayer 13 years ago
parent
commit
58f30175e1
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavutil/mem.c

+ 1
- 1
libavutil/mem.c View File

@@ -84,7 +84,7 @@ void *av_malloc(size_t size)
ptr = malloc(size + ALIGN);
if (!ptr)
return ptr;
diff = ((-(long)ptr - 1)&(ALIGN - 1)) + 1;
diff = ((~(long)ptr)&(ALIGN - 1)) + 1;
ptr = (char *)ptr + diff;
((char *)ptr)[-1] = diff;
#elif HAVE_POSIX_MEMALIGN


Loading…
Cancel
Save