LCOV - code coverage report
Current view: top level - sal/osl/unx - memory.c (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 7 8 87.5 %
Date: 2014-11-03 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  */
       9             : 
      10             : #include <internal/oslmemory.h>
      11             : 
      12             : #include <stdlib.h>
      13             : #ifdef __ANDROID__
      14             : #include <malloc.h>
      15             : #endif
      16             : 
      17          28 : void* osl_aligned_alloc( sal_Size align, sal_Size size )
      18             : {
      19          28 :     if (size == 0)
      20             :     {
      21           0 :         return NULL;
      22             :     }
      23             :     else
      24             :     {
      25             : #if defined __ANDROID__
      26             :         return memalign(align, size);
      27             : #else
      28             :         void* ptr;
      29          28 :         int err = posix_memalign(&ptr, align, size);
      30          28 :         return err ? NULL : ptr;
      31             : #endif
      32             :     }
      33             : }
      34             : 
      35          28 : void osl_aligned_free( void* p )
      36             : {
      37          28 :     free(p);
      38          28 : }
      39             : 
      40             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10