1 /*
2  *  R : A Computer Language for Statistical Data Analysis
3  *  Copyright (C) 1998-2016  The R Core Team
4  *
5  *  This header file is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU Lesser General Public License as published by
7  *  the Free Software Foundation; either version 2.1 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This file is part of R. R is distributed under the terms of the
11  *  GNU General Public License, either Version 2, June 1991 or Version 3,
12  *  June 2007. See doc/COPYRIGHTS for details of the copyright status of R.
13  *
14  *  This program is distributed in the hope that it will be useful,
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *  GNU Lesser General Public License for more details.
18  *
19  *  You should have received a copy of the GNU Lesser General Public License
20  *  along with this program; if not, a copy is available at
21  *  https://www.R-project.org/Licenses/
22  *
23  *
24  * Memory Allocation (garbage collected) --- INCLUDING S compatibility ---
25  */
26 
27 /* Included by R.h: API */
28 
29 #ifndef R_EXT_MEMORY_H_
30 #define R_EXT_MEMORY_H_
31 
32 #if defined(__cplusplus) && !defined(DO_NOT_USE_CXX_HEADERS)
33 # include <cstddef>
34 # define R_SIZE_T std::size_t
35 #else
36 # include <stddef.h> /* for size_t */
37 # define R_SIZE_T size_t
38 #endif
39 
40 #ifdef  __cplusplus
41 extern "C" {
42 #endif
43 
44 void*	vmaxget(void);
45 void	vmaxset(const void *);
46 
47 void	R_gc(void);
48 int	R_gc_running();
49 
50 char*	R_alloc(R_SIZE_T, int);
51 long double *R_allocLD(R_SIZE_T nelem);
52 char*	S_alloc(long, int);
53 char*	S_realloc(char *, long, long, int);
54 
55 void *  R_malloc_gc(size_t);
56 void *  R_calloc_gc(size_t, size_t);
57 void *  R_realloc_gc(void *, size_t);
58 
59 #ifdef  __cplusplus
60 }
61 #endif
62 
63 #endif /* R_EXT_MEMORY_H_ */
64