/////////////////////////////////////////////////////////////////////////////// // // Module : purescript.hh // Copyright : (c) Andy Arvanitis 2016 // License : MIT // // Maintainer : Andy Arvanitis // Stability : experimental // Portability : // // Includes and macros for garbage collection options // /////////////////////////////////////////////////////////////////////////////// // #ifndef PureScript_GC_HH #define PureScript_GC_HH #if defined(USE_GC) #define GC_THREADS #include #include #define WITH_ALLOCATOR(T) , traceable_allocator #define SHARED_TYPE(T) T* #define MAKE_SHARED(T) new (GC) T #define IS_POINTER_TYPE(T) std::is_pointer #define POINTER_FROM_MEMBER(P) P #define INITIALIZE_GC(_) GC_INIT() #else #include #define WITH_ALLOCATOR(_) #define SHARED_TYPE(T) std::shared_ptr #define MAKE_SHARED(T) std::make_shared #define IS_POINTER_TYPE(T) std::is_assignable,T> #define POINTER_FROM_MEMBER(P) P.get() #define INITIALIZE_GC(_) #endif #endif // PureScript_GC_HH