LCOV - code coverage report
Current view: top level - src/base - pdf-alloc.c (source / functions) Hit Total Coverage
Test: libgnupdf.info Lines: 10 10 100.0 %
Date: 2011-12-09 Functions: 3 3 100.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* -*- mode: C -*-
       2                 :            :  *
       3                 :            :  *       File:         pdf-alloc.c
       4                 :            :  *       Date:         Fri Feb 22 21:05:05 2008
       5                 :            :  *
       6                 :            :  *       GNU PDF Library - Memory De/Allocation Module
       7                 :            :  *
       8                 :            :  */
       9                 :            : 
      10                 :            : /* Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. */
      11                 :            : 
      12                 :            : /* This program is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU General Public License as published by
      14                 :            :  * the Free Software Foundation, either version 3 of the License, or
      15                 :            :  * (at your option) any later version.
      16                 :            :  *
      17                 :            :  * This program is distributed in the hope that it will be useful,
      18                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      19                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      20                 :            :  * GNU General Public License for more details.
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU General Public License
      23                 :            :  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
      24                 :            :  */
      25                 :            : 
      26                 :            : #include <config.h>
      27                 :            : 
      28                 :            : #ifdef HAVE_MALLOC_H
      29                 :            : #include <malloc.h>
      30                 :            : #else
      31                 :            : #include <stdlib.h>
      32                 :            : #endif /* HAVE_MALLOC_H */
      33                 :            : 
      34                 :            : #include <pdf-alloc.h>
      35                 :            : 
      36                 :            : inline void *
      37                 :      97542 : pdf_alloc (const pdf_size_t size)
      38                 :            : {
      39                 :            :   void *pointer;
      40                 :            : 
      41                 :      97542 :   pointer = malloc (size);
      42                 :      97542 :   return pointer;
      43                 :            : }
      44                 :            : 
      45                 :            : inline void
      46                 :     111679 : pdf_dealloc (const void *pointer)
      47                 :            : {
      48                 :            :   void *p;
      49                 :            :   
      50                 :            :   /* Avoid a cast to the free argument, so maint.mk doesnt
      51                 :            :      complaint */
      52                 :     111679 :   p = (void *) pointer;
      53                 :     111679 :   free (p);
      54                 :     111679 : }
      55                 :            : 
      56                 :            : inline void *
      57                 :       8667 : pdf_realloc (const void *pointer, const pdf_size_t size)
      58                 :            : {
      59                 :       8667 :   pointer = realloc ((void *) pointer, size);
      60                 :       8667 :   return (void *) pointer;
      61                 :            : }
      62                 :            : 
      63                 :            : /* End of pdf-alloc.c */

Generated by: LCOV version 1.8