--- parser3/src/include/pa_memory.h 2020/12/20 20:45:24 1.42 +++ parser3/src/include/pa_memory.h 2026/04/25 13:38:46 1.47 @@ -1,15 +1,15 @@ /** @file Parser: memory reference counting classes decls. - Copyright (c) 2001-2020 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com) - Author: Alexandr Petrosian (http://paf.design.ru) + Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_MEMORY_H #define PA_MEMORY_H -#define IDENT_PA_MEMORY_H "$Id: pa_memory.h,v 1.42 2020/12/20 20:45:24 moko Exp $" +#define IDENT_PA_MEMORY_H "$Id: pa_memory.h,v 1.47 2026/04/25 13:38:46 moko Exp $" // include @@ -113,9 +113,14 @@ typedef PA_Allocated PA_Object; #define PA_THROW(what) throw(what) #endif -#if !defined(_MSC_VER) && !defined(FREEBSD1X) +#if defined(_MSC_VER) || defined(FREEBSD1X) || defined(__APPLE__) +// no checks for FreeBSD1X.X and OS X due to https://bugs.llvm.org/show_bug.cgi?id=40161 bug +#define PA_CHECK_REGULAR_ALLOC_UNAVAILABLE +#endif + +// #define PA_CHECK_REGULAR_ALLOC_UNAVAILABLE +#if !defined(PA_CHECK_REGULAR_ALLOC_UNAVAILABLE) // regular new/delete are disabled from accidental use -// no checks for FreeBSD1X.X due to https://bugs.llvm.org/show_bug.cgi?id=40161 bug void *new_disabled(); void delete_disabled(); @@ -147,10 +152,7 @@ inline char *strdup(const char*, size_t) #endif // _MSC_VER -#ifdef PA_DEBUG_DISABLE_GC -#define PA_GC_GCOLLECT -#else -#define PA_GC_GCOLLECT { GC_enable(); GC_gcollect(); GC_disable(); } -#endif +void pa_gc_collect(bool forced=false); +void pa_gc_set_free_space_divisor(int); #endif