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 : pdf_alloc (const pdf_size_t size)
38 65221 : {
39 : void *pointer;
40 :
41 65221 : pointer = malloc (size);
42 65221 : return pointer;
43 : }
44 :
45 : inline void
46 : pdf_dealloc (const void *pointer)
47 60011 : {
48 : void *p;
49 :
50 : /* Avoid a cast to the free argument, so maint.mk doesnt
51 : complaint */
52 60011 : p = (void *) pointer;
53 60011 : free (p);
54 60011 : }
55 :
56 : inline void *
57 : pdf_realloc (const void *pointer, const pdf_size_t size)
58 784 : {
59 784 : pointer = realloc ((void *) pointer, size);
60 784 : return (void *) pointer;
61 : }
62 :
63 : /* End of pdf-alloc.c */
|