Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
eval-gc.hh
Go to the documentation of this file.
1#pragma once
3
4#include <cstddef>
5
6#if HAVE_BOEHMGC
7
8# define GC_INCLUDE_NEW
9
10# include <gc/gc.h>
11# include <gc/gc_cpp.h>
12# include <gc/gc_allocator.h>
13
14#else
15
16# include <memory>
17
18/* Some dummy aliases for Boehm GC definitions to reduce the number of
19 #ifdefs. */
20
21template<typename T>
22using traceable_allocator = std::allocator<T>;
23
24template<typename T>
25using gc_allocator = std::allocator<T>;
26
27# define GC_MALLOC_ATOMIC std::malloc
28
29struct gc
30{};
31
32#endif
33
34namespace nix {
35
39void initGC();
40
44void assertGCInitialized();
45
46#ifdef HAVE_BOEHMGC
50size_t getGCCycles();
51#endif
52
53} // namespace nix
Definition eval-gc.hh:30