/
ne1ghost
/
nix
Обзор
Документация
Войти
/
ne1ghost
/
nix
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/libexpr/eval-gc.hh
53 строки
762 B
Robert Hensing
Merge pull request #11619 from NaN-git/fix-disable-gc
01 окт 2024, 15:55
Не верифицирован
01 окт 2024, 15:55
417d556
Код
Авторство
О чём код?
#pragma once ///@file #include <cstddef> #if HAVE_BOEHMGC # define GC_INCLUDE_NEW # include <gc/gc.h> # include <gc/gc_cpp.h> # include <gc/gc_allocator.h> #else # include <memory> /* Some dummy aliases for Boehm GC definitions to reduce the number of #ifdefs. */ template<typename T> using traceable_allocator = std::allocator<T>; template<typename T> using gc_allocator = std::allocator<T>; # define GC_MALLOC_ATOMIC std::malloc struct gc {}; #endif namespace nix { /** * Initialise the Boehm GC, if applicable. */ void initGC(); /** * Make sure `initGC` has already been called. */ void assertGCInitialized(); #ifdef HAVE_BOEHMGC /** * The number of GC cycles since initGC(). */ size_t getGCCycles(); #endif } // namespace nix