source: src/examples/gc_no_raii/src/allocate-pool.c @ 6be0cf9

aaron-thesisarm-ehcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerresolv-newwith_gc
Last change on this file since 6be0cf9 was 6be0cf9, checked in by Thierry Delisle <tdelisle@…>, 6 years ago

gcpointers.c compiles

  • Property mode set to 100644
File size: 1.2 KB
Line 
1#define _BSD_SOURCE /* for MAP_ANON */
2#define _DARWIN_C_SOURCE /* for MAP_ANON on OS X */
3
4/* for standards info */
5#if defined(unix) || defined(__unix) || defined(__unix__) || \
6    (defined(__APPLE__) && defined(__MACH__))
7#include <unistd.h>
8#endif
9
10#if defined(_WIN32)
11#ifndef WIN32_LEAN_AND_MEAN
12#define WIN32_LEAN_AND_MEAN
13#endif
14#include <windows.h>
15#endif
16
17#include <errno.h>
18#include <stdlib.h>
19#include <stdio.h>
20#include <string.h>
21#include <sys/types.h>
22
23#if _POSIX_VERSION
24#include <sys/mman.h>
25#endif
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31/* figure out which allocator to use */
32#if defined(GGGGC_USE_MALLOC)
33#define GGGGC_ALLOCATOR_MALLOC 1
34#include "allocate-malloc.cpp"
35
36#elif _POSIX_ADVISORY_INFO >= 200112L
37#define GGGGC_ALLOCATOR_POSIX_MEMALIGN 1
38#include "allocate-malign.cpp"
39
40#elif defined(MAP_ANON)
41#define GGGGC_ALLOCATOR_MMAP 1
42#include "allocate-mmap.cpp"
43
44#elif defined(_WIN32)
45#define GGGGC_ALLOCATOR_VIRTUALALLOC 1
46#include "allocate-win-valloc.cpp"
47
48#else
49#warning GGGGC: No allocator available other than malloc!
50#define GGGGC_ALLOCATOR_MALLOC 1
51#include "allocate-malloc.cpp"
52
53#endif
54
55void* pal_allocPool(size_t size, int mustSucceed)
56{
57      return allocPool(size, mustSucceed);
58}
59
60#ifdef __cplusplus
61}
62#endif
Note: See TracBrowser for help on using the repository browser.