diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-02-28 09:30:06 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-02-28 09:30:06 +0100 |
commit | 9dfa48405fff9fe03519804c962d0f73951deb64 (patch) | |
tree | 1b2e07b2a4cc1fdaaae66e2005b72f8e623ecdb4 /sal | |
parent | Android does not have posix_memalign() (diff) | |
download | core-9dfa48405fff9fe03519804c962d0f73951deb64.tar.gz core-9dfa48405fff9fe03519804c962d0f73951deb64.zip |
Missing @since tags, and adapt to semantics of posix_memalign
Change-Id: I677d973fbcf118111b5fc93b09143c66b0afb0d9
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/memory.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sal/osl/unx/memory.c b/sal/osl/unx/memory.c index 2b6c20f47d1c..ca241b10d103 100644 --- a/sal/osl/unx/memory.c +++ b/sal/osl/unx/memory.c @@ -19,9 +19,16 @@ void* osl_aligned_alloc( sal_Size align, sal_Size size ) #ifdef __ANDROID__ return memalign(align, size); #else - void* ptr; - int err = posix_memalign(&ptr, align, size); - return err ? NULL : ptr; + if (size == 0) + { + return NULL; + } + else + { + void* ptr; + int err = posix_memalign(&ptr, align, size); + return err ? NULL : ptr; + } #endif } |