79a6a97e6b14af329eac3516c92fddb0694e81a0
[pspp-builds.git] / src / libpspp / alloc.h
1 /* PSPP - computes sample statistics.
2    Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
3
4    This program is free software; you can redistribute it and/or
5    modify it under the terms of the GNU General Public License as
6    published by the Free Software Foundation; either version 2 of the
7    License, or (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful, but
10    WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program; if not, write to the Free Software
16    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17    02110-1301, USA. */
18
19 #if !alloc_h
20 #define alloc_h 1
21
22 #include <stddef.h>
23
24 /* malloc() wrapper functions. */
25 #include "xalloc.h"
26
27 void *nmalloc (size_t n, size_t s);
28
29 /* alloca() wrapper functions. */
30 #if defined HAVE_ALLOCA || defined C_ALLOCA
31 #ifdef HAVE_ALLOCA_H
32 #include <alloca.h>
33 #endif
34 #define local_alloc(X) alloca (X)
35 #define local_free(P) ((void) 0)
36 #else
37 #define local_alloc(X) xmalloc (X)
38 #define local_free(P) free (P)
39 #endif
40
41 #endif /* alloc.h */