summaryrefslogtreecommitdiff
path: root/doc
Commit message (Collapse)AuthorAgeFilesLines
* Make Emscripten Asyncify feature optionalJukka Jylanki2022-11-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #506 (bdwgc). "-sASYNCIFY" is a relatively rarely used feature of Emscripten, most developers do not use it, and it does not scale well to moderate-to-large codebases. It incurs a heavy impact to code size and performance, and carries other correctness problems that developers must then adhere to regarding event loop message ordering. This commit provides new option in cmake (-Denable_emscripten_asyncify) and configure (--enable-emscripten-asyncify) scripts to turn on Emscripten Asyncify feature on demand. * CMakeLists.txt (enable_emscripten_asyncify): New option (off by default). * CMakeLists.txt (EMSCRIPTEN): Define using check_c_source_compiles. * CMakeLists.txt [EMSCRIPTEN && enable_emscripten_asyncify] (EMSCRIPTEN_ASYNCIFY): Define C macro. * CMakeLists.txt [EMSCRIPTEN && enable_emscripten_asyncify] (CMAKE_EXE_LINKER_FLAGS): Append "-sASYNCIFY" and "-sASYNCIFY_STACK_SIZE=128000". * configure.ac (emscripten): Remove quotes for the error directive message. * configure.ac [emscripten] (gc_cflags): Move comment and assignment down (to be after reporting result for emscripten). * configure.ac (emscripten-asyncify): New AC_ARG_ENABLE option; add comment. * configure.ac [enable_emscripten_asyncify && emscripten] (gc_cflags): Add -D EMSCRIPTEN_ASYNCIFY; remove space after "-s". * configure.ac [emscripten] (gc_cflags): Append "-sASYNCIFY" and "-sASYNCIFY_STACK_SIZE=128000" only if enable_emscripten_asyncify. * doc/README.macros (EMSCRIPTEN_ASYNCIFY): Document. * os_dep.c [!ECOS && !NOSYS && !SYMBIAN && EMSCRIPTEN]: Make USE_EMSCRIPTEN_SCAN_STACK has effect only if EMSCRIPTEN_ASYNCIFY. * os_dep.c [THREADS && EMSCRIPTEN]: Include emscripten.h only if EMSCRIPTEN_ASYNCIFY. * os_dep.c [THREADS && EMSCRIPTEN] (scan_regs_cb, GC_default_push_other_roots): Define as a function only if EMSCRIPTEN_ASYNCIFY; update comment. Co-authored-by: Ivan Maidanski <ivmai@mail.ru>
* Refine gcinterface.md that the allocator belongs to SGI STLIvan Maidanski2022-11-211-1/+1
| | | | | * doc/gcinterface.md (C interface): Outline that "malloc_alloc" name belongs to STL (not libgc).
* Fix gccpp and gctba library names in gcinterface.mdIvan Maidanski2022-11-211-3/+3
| | | | | | * doc/gcinterface.md (Class inheritance, C interface): Change "libgccpp" and "libgctba" to "gccpp" and "gctba", respectively (i.e., remove "lib" prefix).
* Mention gctba library in README.cmakeIvan Maidanski2022-11-211-1/+1
| | | | | | | | (fix of commit 3efd0bc4e) * doc/README.cmake (BUILD PROCESS): Mention gctba along with gccpp (i.e. -Denable_cplusplus=ON option forces cmake to build also gctba library by default).
* Fix cmake usage instructions in README to build and run testsIvan Maidanski2022-11-211-1/+1
| | | | | | | | | | (fix of commit 4dfd06514) Issue #501 (bdwgc). * README.md (Installation and Portability): Pass -Dbuild_tests=ON to cmake. * doc/README.cmake (BUILD PROCESS): Likewise.
* Redirect reallocarray() in leak_detector.hIvan Maidanski2022-11-021-3/+3
| | | | | | | | | Issue #491 (bdwgc). * doc/leak.md: Mention reallocarray function; reorder redirected functions list. * include/gc/leak_detector.h (reallocarray): Redefine to GC_REALLOC(). * tests/leak.c (main): Call reallocarray() in a loop.
* Fix mistyped function name in documentation of REDIRECT_REALLOCIvan Maidanski2022-11-021-1/+1
| | | | | * doc/README.macros (REDIRECT_REALLOC): Fix typo ("realloc" w/o GC_ prefix).
* Define public GC_[p]valloc() and redirect to them in leak_detector.hIvan Maidanski2022-10-282-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #495 (bdwgc). * doc/README.macros (GC_NO_VALLOC): Document. * doc/leak.md: Mention GNU valloc and pvalloc functions. * include/gc/gc.h (GC_memalign): Remove comment that it is not tested; add comment describing the functionality and a note. * include/gc/gc.h [!GC_NO_VALLOC] (GC_valloc, GC_pvalloc): Declare new API function. * include/gc/leak_detector.h [!GC_NO_VALLOC] (valloc, pvalloc): Redefine to the corresponding GC_ function. * include/private/gc_priv.h (GC_page_size): Add comment. * include/private/gc_priv.h (GC_real_page_size): Declare new variable (or as a macro). * include/private/gcconfig.h [NACL] (GETPAGESIZE): Add TODO item. * mallocx.c (GC_memalign): Likewise. * tests/gctest.c (run_one_test): Likewise. * include/private/gcconfig.h [CYGWIN32 && (MPROTECT_VDB || USE_MUNMAP) || !MSWIN32 && !MSWINCE && !CYGWIN32 && (GC_DISABLE_INCREMENTAL || DEFAULT_VDB) && !USE_MMAP] (ALT_PAGESIZE_USED): Define macro. * include/private/gcconfig.h [CYGWIN32 && (MPROTECT_VDB || USE_MUNMAP) || !MSWIN32 && !MSWINCE && !CYGWIN32 && (GC_DISABLE_INCREMENTAL || DEFAULT_VDB) && !USE_MMAP && !GC_NO_VALLOC] (REAL_PAGESIZE_NEEDED): Likewise. * mallocx.c (GC_strdup): Reformat comment. * mallocx.c [!GC_NO_VALLOC] (GC_valloc, GC_pvalloc): Implement. * os_dep.c [REAL_PAGESIZE_NEEDED] (GC_real_page_size): Define variable. * os_dep.c [MSWIN32 || MSWINCE || CYGWIN32] (GC_setpagesize): Replace CYGWIN32&&(MPROTECT_VDB||USE_MUNMAP) to ALT_PAGESIZE_USED; remove comment that a separate variable could be added; reformat comment; assert about GC_pagesize only if REAL_PAGESIZE_NEEDED. * os_dep.c [ALT_PAGESIZE_USED && REAL_PAGESIZE_NEEDED] (GC_setpagesize): Set GC_real_page_size. * os_dep.c [!MSWIN32 && !MSWINCE && !CYGWIN32] (GC_setpagesize): Replace MPROTECT_VDB||PROC_VDB||SOFT_VDB||USE_MMAP to !ALT_PAGESIZE_USED. * tests/gctest.c [!GC_NO_VALLOC] (run_one_test): Call GC_valloc() and GC_pvalloc().
* Adjust naming of Win32/64 and x86/64 words in comments and documentationIvan Maidanski2022-09-268-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ChangeLog: Replace i386 and X86 to x86; replace x86_64 and amd64 to x64; replace "Win32 pthreads" to pthreads-win32; lower case win32s, x86, x64; replace win32 to Win32; replace "MS Windows" to Windows (in documentation and comments). * NT_MAKEFILE: Likewise. * README.md: Likewise. * configure.ac: Likewise. * cord/tests/de_win.c: Likewise. * doc/README.macros: Likewise. * doc/README.solaris2: Likewise. * doc/README.win32: Likewise. * doc/README.win64: Likewise. * doc/debugging.md: Likewise. * doc/leak.md: Likewise. * doc/overview.md: Likewise. * doc/porting.md: Likewise. * extra/msvc_dbg.c: Likewise. * finalize.c: Likewise. * include/gc/cord.h: Likewise. * include/gc/gc.h: Likewise. * include/private/gc_priv.h: Likewise. * include/private/gcconfig.h: Likewise. * include/private/pthread_stop_world.h: Likewise. * mach_dep.c: Likewise. * mark.c: Likewise. * mark_rts.c: Likewise. * misc.c: Likewise. * os_dep.c: Likewise. * tools/threadlibs.c: Likewise. * win32_threads.c: Likewise. * cord/tests/de.c (WIN32): Remove misleading comment. * misc.c (GC_enable_incremental): Change comment about win32s to TODO item.
* Fix hb_obj_kind type in documentation (ASCII diagram) describing hblkhdrIvan Maidanski2022-08-031-1/+3
| | | | | * doc/tree.md (A picture): Change type of hb_obj_kind (of hblkhdr) from ushort to uchar; add hb_flags field right after hb_obj_kind.
* Fix SUNOS5SIGS documentation to match macro definition in gcconfig.hIvan Maidanski2022-07-051-2/+1
| | | | | * doc/README.macros (SUNOS5SIGS): Update documentation (mention FreeBSD to match that in gcconfig.h).
* Prevent (fix) parallel custom mark procs run in single-threaded clientsIvan Maidanski2022-06-012-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the collector is built with parallel marker support then marking is performed in parallel on multi-core targets. Thus, if the client provides custom mark procedures, then they could be executed in parallel. In case of a single-threaded client (developed for the older libgc version with the parallel mark support off), its custom mark procedures might not be prepared to be launched in parallel. Now, the parallel mark threads are not launched, even if available, until the client starts a (user) thread (e.g. calls pthread_create or GC_allow_register_threads) or tells the collector explicitly to start the mark threads (by calling GC_start_mark_threads). * doc/README.macros (GC_ALWAYS_MULTITHREADED): Update documentation. * doc/scale.md (Options for enhanced scalability): Likewise. * include/gc/gc.h [GC_THREADS] (GC_parallel, GC_allow_register_threads): Update comment. * include/gc/gc.h (GC_set_markers_count, GC_start_mark_threads): Likewise. * include/gc/gc_mark.h (GC_mark_proc): Likewise. * include/gc/gc_mark.h (GC_PROC_BYTES, GC_ms_entry): Move upper to be before the comment belonging to GC_mark_proc. * misc.c [THREADS && PARALLEL_MARK] (GC_init): Do not call GC_start_mark_threads_inner(). * misc.c [PARALLEL_MARK] (GC_start_mark_threads): Call GC_start_mark_threads_inner() even if THREAD_SANITIZER or no CAN_HANDLE_FORK. * misc.c [THREADS] (GC_get_parallel): Remove comment. * pthread_support.c [PARALLEL_MARK && !CAN_HANDLE_FORK] (available_markers_m1): Define as a variable. * win32_threads.c [PARALLEL_MARK && !CAN_HANDLE_FORK] (available_markers_m1): Likewise. * pthread_support.c [PARALLEL_MARK && !CAN_HANDLE_FORK] (GC_wait_for_gc_completion): Declare. * pthread_support.c [PARALLEL_MARK && !CAN_HANDLE_FORK] (GC_start_mark_threads_inner): If GC_parallel then return; call GC_wait_for_gc_completion(); set GC_markers_m1 value from available_markers_m1. * win32_threads.c [PARALLEL_MARK && (!GC_PTHREADS_PARAMARK || !CAN_HANDLE_FORK)] (GC_start_mark_threads_inner): Likewise. * pthread_support.c [CAN_HANDLE_FORK && PARALLEL_MARK && THREAD_SANITIZER] (fork_child_proc): Set available_markers_m1 to 0. * pthread_support.c [CAN_HANDLE_FORK]: Move GC_remove_all_threads_but_me() call to be after setting available_markers_m1. * pthread_support.c (GC_allow_register_threads): Call GC_start_mark_threads(). * tests/middle.c (main): Likewise. * win32_threads.c (GC_allow_register_threads): Likewise. * pthread_support.c [PARALLEL_MARK] (pthread_create): Call GC_start_mark_threads() unless GC_parallel or available_markers_m1<=0. * win32_threads.c (START_MARK_THREADS): Define macro (to call GC_start_mark_threads() if PARALLEL_MARK). * win32_threads.c (GC_CreateThread): Call START_MARK_THREADS() (right before set_need_to_lock). * win32_threads.c [!CYGWIN32 && !MSWINCE && !MSWIN_XBOX1 && !NO_CRT] (GC_beginthreadex): Likewise. * win32_threads.c [GC_PTHREADS] (GC_pthread_create): Likewise.
* Change default GC_time_limit value from 50 to 15 msIvan Maidanski2022-05-061-1/+1
| | | | | | | | | | * alloc.c [(!GC_TIME_LIMIT || CPPCHECK) && !PARALLEL_MARK] (GC_time_limit): Change value from 50 to 15. * pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL && GC_ENABLE_SUSPEND_THREAD && (!GC_TIME_LIMIT || CPPCHECK)] (GC_brief_async_signal_safe_sleep): Likewise. * doc/gcdescr.md (Generational Collection and Dirty Bits): Change the default value of predetermined amount of time from 50 ms to 15 ms.
* Rename MAP_LEN internal macro to OBJ_MAP_LENIvan Maidanski2022-03-051-1/+1
| | | | | | | | | | | | | (refactoring) * doc/tree.md (A picture): Rename MAP_LEN to OBJ_MAP_LEN. * obj_map.c [MARK_BIT_PER_GRANULE] (GC_add_map_entry): Likewise. * include/private/gc_priv.h (hblkhdr.hb_marks): Reformat comment (to have quoted phrase on a line). * include/private/gc_priv.h [MARK_BIT_PER_GRANULE] (MAP_LEN): Rename to OBJ_MAP_LEN. * obj_map.c [MARK_BIT_PER_GRANULE] (GC_add_map_entry): Replace BYTES_TO_GRANULES(HBLKSIZE) to OBJ_MAP_LEN.
* Allow to unmap memory block right in GC cycle where block is freedIvan Maidanski2022-02-272-7/+8
| | | | | | | | | | | | | | | | | | | | | This commit changes how GC_unmap_threshold is interpreted: GC_unmap_threshold==N now means block is returned to OS if the block is freed N-1 collections ago (previously was: N collections ago). * allchblk.c [USE_MUNMAP && !MUNMAP_THRESHOLD] (MUNMAP_THRESHOLD): Change value from 6 to 7. * configure.ac [$enable_munmap!=no && ($MUNMAP_THRESHOLD="" || $MUNMAP_THRESHOLD=yes)] (MUNMAP_THRESHOLD): Likewise. * allchblk.c [USE_MUNMAP] (GC_unmap_old): Go on with unmapping also if GC_gc_no==hb_last_reclaimed+GC_unmap_threshold; update comment. * configure.ac (munmap): Update help string (including change of the default value from 6 to 7). * configure.ac [$enable_munmap!=no] (MUNMAP_THRESHOLD): Likewise. * doc/README.environment (GC_UNMAP_THRESHOLD): Update documentation. * doc/README.macros (MUNMAP_THRESHOLD): Likewise. * include/private/gcconfig.h [USE_MUNMAP && !MUNMAP_THRESHOLD && (SN_TARGET_PS3 || SN_TARGET_PSP2 || MSWIN_XBOX1)] (MUNMAP_THRESHOLD): Change value from 2 to 3.
* Name all tests consistentlyIvan Maidanski2022-02-073-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (refactoring) In brief, the tests naming as follows: all test executable files end with "test" (not "_test"); all test source files do not have "test" suffix (except for gctest); test.c is named now as gctest.c. * CMakeLists.txt: Rename leak_test.c to leak.c; rename huge_test.c to huge.c; rename leak_test.c to leak.c; rename realloc_test.c to realloc.c; rename smash_test.c to smash.c; rename staticrootslib.c to staticroots_lib.c; rename trace_test.c to trace.c; rename thread_leak_test.c to threadleak.c; rename threadkey_test to threadkey_test; rename threadkey_test.c to threadkey.c; rename subthreadcreate_test to subthreadcreatetest; rename subthread_create.c to subthreadcreate.c; rename initsecondarythread_test to initfromthreadtest; rename initsecondarythread.c to initfromthread.c; rename disclaim_test to disclaimtest; rename disclaim_test.c to disclaim.c; rename disclaim_weakmap_test to weakmaptest; rename disclaim_weakmap_test.c to weakmap.c. * tests/tests.am: Likewise. * CMakeLists.txt: Rename test.c to gctest.c; rename test_cpp to cpptest; rename test_cpp.cc to cpp.cc. * Makefile.direct: Likewise. * NT_MAKEFILE: Likewise. * README.md (Installation and Portability): Likewise. * WCC_MAKEFILE: Likewise. * digimars.mak: Likewise. * doc/README.Mac: Likewise. * tests/tests.am: Likewise. * CMakeLists.txt: rename test_atomic_ops.c to atomicops.c; rename test_atomic_ops to atomicopstest. * configure.ac [$with_libatomic_ops=check]: Likewise. * ChangeLog (8.3.0): Rename threadkey_test to threadkeytest; rename test_atomic_ops to atomicopstest; rename test_cpp to cpptest. * Makefile.direct: Rename test.o to gctest.o. * NT_MAKEFILE: Rename test_cpp.exe to cpptest.exe; rename test.obj to gctest.obj. * WCC_MAKEFILE: Likewise. * digimars.mak: Likewise. * doc/README.win64: Likewise. * configure.ac: Rename test_cpp to cpptest in comment. * doc/leak.md: Rename leak_test.c to leak.c. * tests/test_atomic_ops.c: Rename to atomicops.c; remove test name in "skipped" message. * tests/test_cpp.cc: Rename to cpp.cc; rename test_cpp to cpptest. * tests/disclaim_test.c: Rename to disclaim.c. * tests/test.c: Rename to gctest.c. * tests/huge_test.c: Rename to huge.c. * tests/initsecondarythread.c: Rename to initfromthread.c. * tests/leak_test.c: Rename to leak.c. * tests/realloc_test.c: Rename to realloc.c. * tests/smash_test.c: Rename to smash.c. * tests/staticrootstest.c: Rename to staticroots.c. * tests/staticrootslib.c: Rename to staticroots_lib.c. * tests/subthread_create.c: Rename to subthreadcreate.c; remove test name in printed messages. * tests/threadkey_test.c: Rename to threadkey.c; remove test name in "skipped" message. * tests/thread_leak_test.c: Rename to threadleak.c. * tests/trace_test.c: Rename to trace.c. * tests/disclaim_weakmap_test.c: Rename to weakmap.c; rename disclaim_test.c to disclaim.c in comment.
* Remove ancient PCR-MakefileIvan Maidanski2021-11-291-1/+2
| | | | | | | | | | | | * Makefile.am (EXTRA_DIST): Remove PCR-Makefile item; reorder items. * Makefile.direct (srcdir): Update comment. * Makefile.direct (pcr): Remove rule. * PCR-Makefile: Remove. * README.md (Installation and Portability): Do not mention PCR has a specific makefile. * doc/README.macros (PCR): Mention PCR-specific defines from PCR-Makefile. * tests/test.c (NTHREADS): Do not mention PCR.
* Do not list all .c files in ancient README.MacIvan Maidanski2021-11-291-20/+1
| | | | | * doc/README.Mac (Files to build the GC libraries): Replace all .c files of the base folder with extra/gc.c one.
* Remove ancient SMakefile.amigaIvan Maidanski2021-11-291-7/+13
| | | | | | | | | | * Makefile.am (EXTRA_DIST): Remove SMakefile.amiga item. * README.md (Installation and Portability): Do not mention Amiga has a specific makefile. * SMakefile.amiga: Remove. * doc/README.amiga: Mention Makefile.direct instead of Makefile. * doc/README.amiga (WHATS NEW): Copy Amiga-specific options and defines from SMakefile.amiga file.
* Remove ancient OS2_MAKEFILEIvan Maidanski2021-11-291-2/+9
| | | | | | | | | | WCC_MAKEFILE could be used instead (for OS/2 target). * Makefile.am (EXTRA_DIST): Remove OS2_MAKEFILE item. * OS2_MAKEFILE: Remove. * WCC_MAKEFILE: Change "OS2" to "OS/2" in the title comment. * doc/README.OS2: Refer to WCC_MAKEFILE instead of OS2_MAKEFILE; copy notes from OS2_MAKEFILE.
* Remove Symbian makefileIvan Maidanski2021-11-291-1/+55
| | | | | | | | | | | * build/s60v3/bld.inf: Remove. * build/s60v3/libgc.mmp: Likewise. * doc/README.symbian: Copy content of bld.inf and libgc.mmp (as a sample build configuration); add global_end.cpp, global_start.cpp, init_global_static_roots.cpp as source files. * Makefile.am (EXTRA_DIST): Remove bld.inf, libgc.mmp items. * README.md (Installation and Portability): Do not mention Symbian-specific makefile.
* Remove doc.am and move gc.man to base folderIvan Maidanski2021-11-252-208/+0
| | | | | | | | | | | | | | | (refactoring) This is to eliminate non-dist-doc files in doc folder. * CMakeLists.txt [enable_docs] (doc/gc.man): Rename to gc.man. * Makefile.am [ENABLE_DOCS] (dist_man3_MANS): Likewise. * Makefile.direct (BSD-pkg-install): Likewise. * Makefile.am: Do not include doc/doc.am. * Makefile.am [ENABLE_DOCS] (dist_doc_DATA, dist_man3_MANS): Copy assignment from doc.am. * doc/doc.am: Remove. * doc/gc.man: Rename to gc.man.
* Adjust link to file with the license in overview.mdIvan Maidanski2021-11-251-1/+1
| | | | | | | (fix of commit 2fd7564a0) * doc/overview.md: Refer to LICENSE file (for licensing terms) instead of README.md file.
* Update README.win32 about default build configuration (configure, cmake)Ivan Maidanski2021-11-251-5/+5
| | | | | | * doc/README.win32: Update information about the build with GNU make (the collector is built as shared library by default); mention that CMake builds the collector with threads support by default.
* Fix a typo in debugging.mdIvan Maidanski2021-11-251-1/+1
| | | | | * doc/debugging.md (Unexpectedly Large Heap): Fix typo "primitives in", add missing space after it.
* Quote all mentioned header files in README.md and debugging.mdIvan Maidanski2021-11-251-2/+2
| | | | | | | * README.md (The C Interface to the Allocator, The C++ Interface to the Allocator): Wrap all (remaining) mentioned .h files in apostrophes. * doc/debugging.md (Unexpectedly Large Heap): Likewise.
* Move public header files to include/gc in source treeIvan Maidanski2021-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, include/extra public header files (for the redirection) are moved to include directory. This is have the same directories structure of public headers in the source tree as that of the installed "include" directory. * doc/finalization.md: Remove "include/" prefix for cord.h. * LICENSE: Rename include/gc_allocator.h to gc/gc_allocator.h. * Makefile.direct (CORD_SRCS, CORD_INCLUDE_FILES): Add "gc/" prefix for cord.h, ec.h, cord_pos.h. * CMakeLists.txt [install_headers]: Likewise. * cord/cord.am (pkginclude_HEADERS): Likewise. * Makefile.direct (SRCS, tests/test.o, dyn_load.o, dyn_load_sunos53.o, mark.o, typd_mlc.o, finalize.o, ptr_chck.o, specific.o, alloc.o, pthread_support.o, thread_local_alloc.o, win32_threads.o): Add "gc/" prefix for gc_typed.h, gc_tiny_fl.h, gc_version.h, gc_inline.h, gc_mark.h, gc_disclaim.h, gc_allocator.h, javaxfc.h, gc_backptr.h, gc_gcj.h, leak_detector.h, gc_pthread_redirects.h, gc_config_macros.h. * NT_MAKEFILE (test.obj): Add gc\ prefix for gc_mark.h, gc_disclaim.h. * NT_MAKEFILE (cord\tests\de.obj, cord\tests\de_win.obj): Add gc\ prefix for cord.h, cord_pos.h. * OS2_MAKEFILE (cord\cordbscs.obj, cord\cordxtra.obj, cord\cordprnt.obj, cordtest.exe): Likewise. * cord/cordbscs.c: Add "gc/" prefix in include for cord.h, ec.h; reorder includes. * cord/cordprnt.c: Likewise. * cord/cordxtra.c: Likewise. * cord/tests/cordtest.c: Likewise. * cord/tests/de.c: Likewise. * cord/tests/de_win.c: Likewise. * extra/gc.c: Add "gc/" prefix in include for gc_inline.h, gc_pthread_redirects.h, javaxfc.h, gc_disclaim.h, gc_gcj.h, gc_backptr.h, gc_mark.h, gc_tiny_fl.h, leak_detector.h., gc_typed.h. * finalize.c: Likewise. * fnlz_mlc.c: Likewise. * gcj_mlc.c: Likewise. * include/private/dbg_mlc.h: Likewise. * include/private/gc_pmark.h: Likewise. * include/private/gc_priv.h: Likewise. * include/private/thread_local_alloc.h: Likewise. * malloc.c: Likewise. * mallocx.c: Likewise. * pthread_stop_world.c: Likewise. * pthread_support.c: Likewise. * reclaim.c: Likewise. * tests/disclaim_bench.c: Likewise. * tests/disclaim_test.c: Likewise. * tests/disclaim_weakmap_test.c: Likewise. * tests/leak_test.c: Likewise. * tests/staticrootstest.c: Likewise. * tests/test.c: Likewise. * tests/thread_leak_test.c: Likewise. * tests/trace_test.c: Likewise. * thread_local_alloc.c: Likewise. * typd_mlc.c: Likewise. * tests/test_cpp.cc: Add "gc/" prefix in include for gc_allocator.h. * include/extra/gc.h: Move to include folder; replace include<> to include "". * include/extra/gc_cpp.h: Likewise. * include/cord.h: Move to include/gc folder. * include/cord_pos.h: Likewise. * include/ec.h: Likewise. * include/gc.h: Likewise. * include/gc_allocator.h: Likewise. * include/gc_backptr.h: Likewise. * include/gc_config_macros.h: Likewise. * include/gc_cpp.h: Likewise. * include/gc_disclaim.h: Likewise. * include/gc_gcj.h: Likewise. * include/gc_inline.h: Likewise. * include/gc_mark.h: Likewise. * include/gc_pthread_redirects.h: Likewise. * include/gc_tiny_fl.h: Likewise. * include/gc_typed.h: Likewise. * include/gc_version.h: Likewise. * include/javaxfc.h: Likewise. * include/leak_detector.h: Likewise. * include/include.am (pkginclude_HEADERS): Add "gc/" prefix for gc.h, gc_backptr.h, gc_config_macros.h, gc_inline.h, gc_mark.h, gc_tiny_fl.h, gc_typed.h, gc_version.h, javaxfc.h, leak_detector.h, gc_disclaim.h, gc_gcj.h, gc_pthread_redirects.h, gc_allocator.h, gc_cpp.h. * CMakeLists.txt [install_headers]: Likewise. * include/include.am (include_HEADERS): Remove "extra/" prefix for gc_cpp.h, gc.h. * CMakeLists.txt [install_headers]: Likewise.
* Move non-license info from LICENSE file to READMEIvan Maidanski2021-11-241-1/+6
| | | | | | | | | | | | | | | | | | * LICENSE: Remove INSTALLATION, TYPICAL USE, WARNINGS sections (i.e., remove all non-license information). * README.md (Overview): Add link to README.cords; some other minor changes; reformat text. * README.md (General Description): Add link to README.win32 and README.win64; reformat text. * README.md (Installation and Portability): Mention CMake before providing exact build commands; add reference to README.cmake and README.macros; mention how to build the collector on Windows; mention that threads are on be default; mention how to build cord library with Makefile.direct mention that Symbian has a separate makefile. * README.md (The C++ Interface to the Allocator): Copy information about building the C++ GC libraries from LICENSE; add link to gcinterface.md. * doc/README.cords: Copy information about cord library building from LICENSE file.
* Exclude licensing terms from README.cords in favor of LICENSEIvan Maidanski2021-11-231-10/+0
| | | | | | | | The licensing terms in README.cords are the same as in LICENSE file. The other documentation files do not contain any licensing information. * doc/README.cords: Remove licensing information (from the beginning of the file).
* Rename README.QUICK to LICENSE and install it by defaultIvan Maidanski2021-11-232-1/+2
| | | | | | | | | | | | | | README.QUICK contains the package copyright and licensing terms, it is more natural to name the file as LICENSE. * CMakeLists.txt [enable_docs] (install): Add LICENSE for $CMAKE_INSTALL_DOCDIR; remove note that README.QUICK is not installed. * README.QUICK: Rename to LICENSE. * Makefile.am (EXTRA_DIST): Do not add README.QUICK. * README.md (Copyright & Warranty, Contributors): Rename README.QUICK to LICENSE. * doc/README.DGUX386: Refer to README.md instead of README.QUICK. * doc/doc.am [ENABLE_DOCS] (dist_doc_DATA): Add LICENSE.
* Add 'lib' prefix to build artifact names in Makefile.directIvan Maidanski2021-11-141-1/+1
| | | | | | | | | | | | | | | This is to match libraries naming convention of CMake and configure scripts. * Makefile.direct: Update comment (add "lib" prefix to gc.a, gccpp.a, gctba.a, cord.a). * Makefile.direct (bsd-libgc.a, bsd-libgccpp.a, bsd-libgctba.a, bsd-libleak.a, base_lib, gc.a, cords, libcord.a, test_cpp, gctba.a, cord.a, c++, gccpp.a, gctba.a, cordtest, de, gctest): Add "lib" prefix to gc.a, gccpp.a, gctba.a, cord.a. * README.QUICK (INSTALLATION, TYPICAL USE): Likewise. * README.md (Installation and Portability): Likewise. * doc/gcinterface.md (C/C++ Interface): Likewise.
* Refer to Makefile.direct instead of deleted Makefile file in READMEIvan Maidanski2021-11-032-3/+3
| | | | | | | | | | | (fix of commit 183c30bb0) * Makefile.am (EXTRA_DIST): Remove outdated comment exclusion of "Makefile" file. * README.QUICK (WARNINGS): Mention "Makefile.am or Makefile.direct" instead of "Makefile". * doc/README.linux: Mention "Makefile.direct" instead of "Makefile". * doc/README.sgi: Likewise.
* Do not name GCC intrinsics as C11 onesIvan Maidanski2021-10-301-2/+2
| | | | | | | | | | * CMakeLists.txt (GC_BUILTIN_ATOMIC): Do not mention C11 in comment (or documentation) when referring to GCC intrinsics. * configure.ac (GC_BUILTIN_ATOMIC): Likewise. * include/private/gc_atomic_ops.h: Likewise. * ChangeLog (8.0.0): Do not mention C11 when referring to GCC intrinsics. * doc/README.macros (GC_BUILTIN_ATOMIC): Likewise.
* Add a link to known uses of bdwgc to READMEIvan Maidanski2021-10-181-2/+1
| | | | | | * README.md (Overview): Add a link to Known-clients page on GitHub. * doc/overview.md (Information provided on the BDWGC site): Remove comment that the list on the Known-clients page is outdated.
* Adjust dist_doc_DATA after renaming README.aixIvan Maidanski2021-10-151-1/+1
| | | | | | | (fix of commit 561484bfc) * doc/doc.am (dist_doc_DATA): Move README.aix to have items ordered lexicographically.
* Rename README.rs6000 to README.aixIvan Maidanski2021-10-132-1/+1
| | | | | | | RS6000 system was renamed to AIX/ppc long ago. * doc/README.rs6000: Rename to doc/README.aix. * doc/doc.am (dist_doc_DATA): Rename README.rs6000 to README.aix.
* [8.2.0]v8.2.0Ivan Maidanski2021-09-291-1/+1
| | | | | | | | | | | | | | | | | | | Bump gc version to 8.2.0 (experimental release) * ChangeLog (8.2.0): Set release date. * CMakeLists.txt (PACKAGE_VERSION): Bump minor version and set micro to 0 (change package version to 8.2.0). * README.md: Likewise. * configure.ac (AC_INIT): Likewise. * include/gc_version.h (GC_TMP_VERSION_MINOR, GC_TMP_VERSION_MICRO): Likewise. * CMakeLists.txt (LIBGCCPP_VER_INFO): Increment current and age (change version info of libgccpp.so to 6:0:5). * Makefile.am (LIBGCCPP_VER_INFO): Likewise. * README.md: Remove build status badges (Travis, AppVeyor, Codecov, Coveralls, Coverity, LGTM). * doc/README.cmake (HOW TO IMPORT BDWGC): Update BDWgc version in the sample.
* Fall back to mprotect-based VDB at runtime if no soft-dirty bit in kernelIvan Maidanski2021-09-042-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #265 (bdwgc). * doc/README.environment (GC_USE_GETWRITEWATCH): Update documentation. * doc/README.macros (GC_PREFER_MPROTECT_VDB): Likewise. * include/private/gc_priv.h [!NO_VDB_FOR_STATIC_ROOTS && !PROC_VDB] (GC_is_vdb_for_static_roots): Declare GC_INNER function. * include/private/gcconfig.h [(I386 || POWERPC || X86_64) && LINUX && __GLIBC__ && !__UCLIBC__ && !SOFT_VDB && !DEFAULT_VDB]: Do not include linux/version.h if NO_SOFT_VDB. * include/private/gcconfig.h [(I386 || POWERPC || X86_64) && LINUX && __GLIBC__ && !__UCLIBC__ && !SOFT_VDB && !DEFAULT_VDB] (SOFT_VDB): Do not define if NO_SOFT_VDB; do not depend on GC_PREFER_MPROTECT_VDB. * include/private/gcconfig.h [MPROTECT_VDB && GC_PREFER_MPROTECT_VDB] (SOFT_VDB): Do not undefine. * include/private/gcconfig.h (MPROTECT_VDB): Do not undefine if SOFT_VDB; update comment. * mark.c [!GC_DISABLE_INCREMENTAL && !NO_VDB_FOR_STATIC_ROOTS && !PROC_VDB] (GC_static_page_was_dirty): Do not examine GC_manual_vdb value; update comment * mark.c [!GC_DISABLE_INCREMENTAL && !NO_VDB_FOR_STATIC_ROOTS && !PROC_VDB] (GC_push_conditional_static): Call GC_push_all() unless GC_is_vdb_for_static_roots(). * os_dep.c: Update comment about SOFT_VDB implementation. * os_dep.c [!OS2 && !GWW_VDB && SOFT_VDB] (GC_GWW_AVAILABLE): Implement to check clear_refs_fd value. * os_dep.c [MPROTECT_VDB && !DARWIN && SOFT_VDB] (soft_dirty_init): Declare static function. * os_dep.c [MPROTECT_VDB && !DARWIN && (GWW_VDB || MSWIN32 || MSWINCE)] (GC_dirty_init): Move code upper (to be right after checking of GC_page_size). * os_dep.c [MPROTECT_VDB && !DARWIN && SOFT_VDB] (GC_dirty_init): Return true if soft_dirty_init(). * os_dep.c [SOFT_VDB] (GC_dirty_init): Rename to soft_dirty_init (and make it static) if MPROTECT_VDB; do not set soft_vdb_buf if already non-null; remove TODO about MPROTECT_VDB. * os_dep.c [SOFT_VDB && MPROTECT_VDB] (soft_dirty_init): Check GC_USE_GETWRITEWATCH environment variable (and return false if the client requested to prefer mprotect-based VDB). * os_dep.c [!GC_DISABLE_INCREMENTAL && !NO_VDB_FOR_STATIC_ROOTS && !PROC_VDB] (GC_is_vdb_for_static_roots): Implement. * tests/test.c [!GC_DISABLE_INCREMENTAL && (TEST_DEFAULT_VDB || !DEFAULT_VDB) && MPROTECT_VDB && SOFT_VDB] (enable_incremental_mode): Print message similar to the case of GWW_VDB and MPROTECT_VDB.
* Use soft dirty bits on Linux (initial implementation, off by default)Ivan Maidanski2021-08-073-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #265 (bdwgc). * doc/README.macros (GC_PREFER_MPROTECT_VDB): Mention SOFT_VDB. * doc/porting.md (Adding Platforms to gcconfig.h): Likewise. * include/private/gcconfig.h: Likewise. * doc/gcdescr.md (Generational Collection and Dirty Bits): Document SOFT_VDB. * os_dep.c: Likewise. * include/private/gcconfig.h [MPROTECT_VDB && GC_PREFER_MPROTECT_VDB || DEFAULT_VDB || GC_DISABLE_INCREMENTAL] (SOFT_VDB): Undefine. * include/private/gcconfig.h [SOFT_VDB] (MPROTECT_VDB): Likewise. * include/private/gcconfig.h [USE_PROC_FOR_LIBRARIES && GC_LINUX_THREADS]: Refine comment. * include/private/gcconfig.h [!PCR_VDB && !PROC_VDB && !MPROTECT_VDB && !GWW_VDB && !DEFAULT_VDB && !GC_DISABLE_INCREMENTAL] (DEFAULT_VDB): Do not define if SOFT_VDB. * include/private/gc_priv.h [CHECKSUMS && SOFT_VDB] (GC_arrays._written_pages): Declare field. * os_dep.c [SOFT_VDB && !PROC_READ] (PROC_READ): Define. * os_dep.c [!MSWIN32 && !MSWINCE && !CYGWIN32 && SOFT_VDB] (GC_setpagesize): Set GC_page_size to GETPAGESIZE(). * os_dep.c [SOFT_VDB] (VDB_BUF_SZ, PAGEMAP_ENTRY_SZ, PM_SOFTDIRTY_OFS, PM_SOFTDIRTY_MASK): Define macro. * os_dep.c [SOFT_VDB] (soft_vdb_buf, clear_refs_fd, pagemap_fd): Declare static variable. * os_dep.c [SOFT_VDB] (open_proc_fd): New static function. * os_dep.c [SOFT_VDB] (GC_dirty_init): Implement. * os_dep.c [SOFT_VDB] (GC_soft_read_dirty): New inline function. * os_dep.c [!GC_DISABLE_INCREMENTAL && SOFT_VDB] (GC_read_dirty): Call GC_soft_read_dirty(). * os_dep.c [CHECKSUMS && SOFT_VDB] (GC_or_pages): Define function. * os_dep.c [!GC_DISABLE_INCREMENTAL && CHECKSUMS && SOFT_VDB] (GC_page_was_ever_dirty): Process GC_written_pages. * tests/test.c [!PCR && !GC_WIN32_THREADS && !GC_DISABLE_INCREMENTAL && (TEST_DEFAULT_VDB || !DEFAULT_VDB) && SOFT_VDB] (main): Print that dirty bits information is obtained from /proc if incremental mode.
* Remove new_gc_alloc.h fileIvan Maidanski2021-07-251-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The removed header was not exported anyway and provided the SGI-style allocators depending on an ancient STL version. * Makefile.direct (SRCS): Remove include/new_gc_alloc.h; rename include/gc_alloc_ptrs.h to include/private/gc_alloc_ptrs.h. * include/include.am (dist_noinst_HEADERS): Likewise. * doc/gcinterface.md (STL allocators): Remove information about SGI-style allocators (defined in new_gc_alloc.h). * include/new_gc_alloc.h: Remove file. * include/gc_alloc_ptrs.h: Move to include/private folder. * include/private/gc_alloc_ptrs.h [!GC_API_PRIV] (GC_API_PRIV): Define. * include/private/gc_alloc_ptrs.h (GC_objfreelist_ptr, GC_aobjfreelist_ptr, GC_uobjfreelist_ptr, GC_incr_bytes_allocd, GC_incr_bytes_freed): Use GC_API_PRIV instead of GC_API. * include/private/gc_alloc_ptrs.h [GC_ATOMIC_UNCOLLECTABLE] (GC_auobjfreelist_ptr): Likewise. * mallocx.c: Include private/gc_alloc_ptrs.h (instead of gc_alloc_ptrs.h). * mallocx.c (GC_incr_bytes_allocd, GC_incr_bytes_freed): Remove GC_API. * tests/test_cpp.cc: Include "gc_allocator.h" (even if DONT_USE_STD_ALLOCATOR). * tests/test_cpp.cc (main): Remove code inside ifdef DONT_USE_STD_ALLOCATOR blocks.
* Export CMake targets with namespace BDWgcSteve Youngs2021-07-081-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #327 (bdwgc). Create and install CMake support files: export all targets to BDWgcTargets; install the BDWgcTargets.cmake file with namespace BDWgc. * CMakeLists.txt: Include CMakePackageConfigHelpers. * CMakeLists.txt (gc): Specify target_include_directories. * CMakeLists.txt [enable_cplusplus] (gccpp): Likewise. * CMakeLists.txt [enable_cplusplus && enable_throw_bad_alloc_library] (gctba): Likewise. * CMakeLists.txt [build_cord] (cord): Likewise. * CMakeLists.txt [build_cord] (cord): Change install export to BDWgcTargets (export all targets to "BDWgcTargets" instead of separate exports). * CMakeLists.txt (gc): Likewise. * CMakeLists.txt [enable_cplusplus] (gccpp): Likewise. * CMakeLists.txt [enable_cplusplus && enable_throw_bad_alloc_library] (gctba): Likewise. * CMakeLists.txt (BDWgcTargets): Specify export (BDWgcTargets.cmake) with namespace "BDWgc". * CMakeLists.txt (Config.cmake.in): Specify configure package config file and write basic package version file. * CMakeLists.txt (BDWgcConfig.cmake, BDWgcConfigVersion.cmake): Specify install. * Config.cmake.in: New file (used to create BDWgcConfig.cmake). * Makefile.am (EXTRA_DIST): Add Config.cmake.in item. * doc/README.cmake (HOW TO IMPORT BDWGC): Add documentation section.
* Add README.emscripten to installed documentation setIvan Maidanski2021-07-081-0/+1
| | | | | | | | (fix of commit 1431bda1a) Issue #354 (bdwgc). * doc/doc.am [ENABLE_DOCS] (dist_doc_DATA): Add README.emscripten.
* Emscripten single-threaded support (detect stack base, push registers)Nguyen Thai Ngoc Duy2021-06-201-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #354 (bdwgc). This adds a bit more in os_dep.c in order to scan the stack and registers, which is possible if we enable ASYNCIFY (note, this adds quite some overhead). gctest almost passes with this, except for the test code that involves a_get(). * configure.ac (emscripten): Define (based __EMSCRIPTEN__ macro presence). * configure.ac [emscripten] (gc_cflags): Append ASYNCIFY[_STACK_SIZE] (to set stack size to 128 KB). * configure.ac [emscripten] (EMSCRIPTEN): Define AM variable. * configure.ac [emscripten] (THREADS): Set to "no" by default. * doc/README.emscripten: New file. * include/private/gcconfig.h [I386 && __EMSCRIPTEN__] (STACK_NOT_SCANNED): Remove it, along with the comment. * include/private/gcconfig.h [I386 && __EMSCRIPTEN__] (USE_MMAP_ANON, STACK_GROWS_DOWN): Define macro. * mach_dep.c [!SN_TARGET_ORBIS && !SN_TARGET_PSP2 && !HAVE_PUSH_REGS && __EMSCRIPTEN__] (GC_with_callee_saves_pushed): Do nothing before fn call. * os_dep.c [__EMSCRIPTEN__]: Include emscripten.h. * os_dep.c [__EMSCRIPTEN__] (emscripten_stack_base): New static variable. * os_dep.c [__EMSCRIPTEN__] (scan_stack_cb): New static function. * os_dep.c [!THREADS && __EMSCRIPTEN__] (scan_regs_cb): Likewise. * os_dep.c [__EMSCRIPTEN__] (GC_get_main_stack_base): Implement. * os_dep.c [!THREADS && __EMSCRIPTEN__] (GC_default_push_other_roots): Likewise. * os_dep.c [__EMSCRIPTEN__] (GET_MAIN_STACKBASE_SPECIAL): Define macro. * os_dep.c [USE_MUNMAP && !USE_WINALLOC && !SN_TARGET_PS3 && __EMSCRIPTEN__]: Do not call mmap or mprotect. * tests/test.c [__EMSCRIPTEN__] (reverse_test_inner): Do not call check_ints(a_get(),1,49); add FIXME. * tests/tests.am [EMSCRIPTEN] (check_PROGRAMS): Add gctest.html. * tests/tests.am [EMSCRIPTEN] (gctest_html_SOURCES, gctest_html_LDADD, gctest_html_LDFLAGS): Define variable.
* Better formatting of list with GC phases in gcdescr.mdMatheus Rambo2021-06-101-18/+29
| | | | | | Issue #344 (bdwgc). * doc/gcdescr.md (Introduction): Add blank line around each phase item.
* Add table of contents in gcdescr.mdMatheus Rambo2021-06-101-0/+11
| | | | | | Issue #344 (bdwgc). * doc/gcdescr.md: Add table of contents.
* New API (GC_set_markers_count) to control number of parallel markersIvan Maidanski2020-08-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #320 (bdwgc). Note that GC_set_markers_count() has effect only if called before GC initialization. For convenience, alternatively the client could define GC_MARKERS macro with the appropriate value before include of gc.h. * doc/README.macros (GC_MARKERS): Document. * include/gc.h [GC_THREADS] (GC_parallel): Update comment. * include/gc.h [GC_THREADS] (GC_set_markers_count): New API function declaration. * include/gc.h (GC_INIT_CONF_MARKERS): New internal macro (defined to GC_set_markers_count(GC_MARKERS) if GC_THREADS and GC_MARKERS are defined). * include/gc.h (GC_INIT): Call GC_INIT_CONF_MARKERS before GC_init. * pthread_support.c [PARALLEL_MARK] (required_markers_cnt): New static variable (initialized to 0). * win32_threads.c [PARALLEL_MARK] (required_markers_cnt): Likewise. * pthread_support.c (GC_set_markers_count): New API function definition (empty unless PARALLEL_MARK). * win32_threads.c [PARALLEL_MARK] (GC_set_markers_count): Likewise. * pthread_support.c [PARALLEL_MARK] (GC_thr_init): Initialize markers local variable to required_markers_cnt; set markers to GC_nprocs only if markers_string is null and required_markers_cnt (markers) value is zero. * tests/test.c [GC_PTHREADS] (main): Call GC_set_markers_count(0) before GC_COND_INIT(). * win32_threads.c [PARALLEL_MARK] (GC_thr_init): Initialize markers local variable to required_markers_cnt; set markers to ncpu only if markers_string is null and required_markers_cnt (markers) value is 0.
* Do not hard-code finalizable objects limit which triggers GCIvan Maidanski2020-07-311-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #304 (bdwgc). Previously, if more than 500 finalizable objects emerged since the latest collection (and the incremental mode is off), then new collection is started instead heap expansion. This led to frequent collections if most allocated objects were with a registered finalizer. Now, the hard coded limit (500) is replaced roughly with (GC_bytes_allocd / GC_allocd_bytes_per_finalizer), where the latter global variable has the default value of 10000 (or GC_ALLOCD_BYTES_PER_FINALIZER if defined) but could be changed by the client with GC_set_allocd_bytes_per_finalizer(). * alloc.c (GC_allocd_bytes_per_finalizer): New STATIC variable (initialized to GC_ALLOCD_BYTES_PER_FINALIZER if defined otherwise to 10000). * alloc.c (GC_set_allocd_bytes_per_finalizer, GC_get_allocd_bytes_per_finalizer): New API function definition. * alloc.c (GC_collect_or_expand): Replace GC_fo_entries>last_fo_entries+500 condition to GC_fo_entries>last_fo_entries && (GC_fo_entries-last_fo_entries)*GC_allocd_bytes_per_finalizer >GC_bytes_allocd. * doc/README.macros (GC_ALLOCD_BYTES_PER_FINALIZER): Document. * include/gc.h (GC_set_allocd_bytes_per_finalizer, GC_get_allocd_bytes_per_finalizer): New API function declaration. * include/gc.h (GC_INIT_CONF_ALLOCD_BYTES_PER_FINALIZER): New internal macro (call GC_set_allocd_bytes_per_finalizer if GC_ALLOCD_BYTES_PER_FINALIZER is defined by client). * include/gc.h (GC_INIT): Call GC_INIT_CONF_ALLOCD_BYTES_PER_FINALIZER. * tests/test.c [!PCR && !GC_WIN32_THREADS && !GC_PTHREADS && CPPCHECK] (main): Call UNTESTED() for GC_get_allocd_bytes_per_finalizer and GC_set_allocd_bytes_per_finalizer.
* Add GC_ prefix to scan_ptr and some other static variablesIvan Maidanski2020-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (code refactoring) The following variables are prefixed: scratch_free_ptr, hdr_free_list, scan_ptr, main_local_mark_stack, roots_were_cleared. * doc/gcdescr.md (Mark phase): Add GC_ prefix to scan_ptr. * headers.c (scratch_free_ptr, hdr_free_list): Add GC_ prefix to name; change static to STATIC. * mark.c (scan_ptr): Likewise. * mark.c [PARALLEL_MARK] (main_local_mark_stack): Likewise. * mark_rts.c (roots_were_cleared): Likewise. * headers.c (GC_scratch_alloc): Add GC_ prefix to scratch_free_ptr. * headers.c (alloc_hdr, free_hdr): Add GC_ prefix to hdr_free_list. * headers.c (GC_init_headers): Add assertion that GC_all_nils is null on entry. * include/private/gc_pmark.h (MS_PUSH_RESCUERS, MS_PUSH_UNCOLLECTABLE, MS_PARTIALLY_INVALID): Add GC_ prefix to scan_ptr. * mark.c (GC_clear_marks, GC_initiate_gc, alloc_mark_stack): Likewise. * mark.c [WRAP_MARK_SOME] (GC_mark_some): Likewise. * mark.c [PARALLEL_MARK] (GC_wait_for_markers_init, GC_do_parallel_mark): Add GC_ prefix to main_local_mark_stack. * mark_rts.c (GC_clear_roots, GC_push_roots): Add GC_ prefix to roots_were_cleared. * mark_rts.c (GC_next_exclusion): Add assertion that GC_excl_table_entries is positive.
* Remove obsolete information in README.darwinIvan Maidanski2019-11-121-56/+0
| | | | | * doc/README.darwin (gc_cpp.h usage, Older Information): Remove information.
* Build gctba libraryIvan Maidanski2019-11-071-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #268 (bdgwc). The library exports only GC_throw_bad_alloc C++ function. It is intended to solve "undefined reference to GC_throw_bad_alloc" linkage error when the client needs to avoid linking with gccpp library (to avoid "::new" redirection, in turn). * CMakeLists.txt (enable_throw_bad_alloc_library): New option (ON by default). * CMakeLists.txt [enable_cplusplus && enable_throw_bad_alloc_library] (gctba): New library. * Makefile.am [CPLUSPLUS && GC_TBA_LIBRARY] (lib_LTLIBRARIES): Add libgctba.la item. * Makefile.am [CPLUSPLUS && GC_TBA_LIBRARY] (libgctba_la_SOURCES, libgctba_la_LIBADD, libgctba_la_LDFLAGS): New variable. * Makefile.direct: Update head comment (mention gctba.a). * Makefile.direct (bsd-libgctba.a, gctba.a): New target. * NT_MAKEFILE (gctba.lib): Likewise. * WCC_MAKEFILE (gctba.lib): Likewise. * WCC_MAKEFILE [!ENABLE_STATIC] (gctba.dll): Likewise. * Makefile.direct (bsd-libgc.a): Move gctba.a to bsd-libgctba.a. * Makefile.direct (BSD-pkg-install): Copy bsd-libgctba.a; install libgctba.a. * Makefile.direct (c++): Add dependency on gc_badalc.o; call rus, $(AR) and $(RANLIB) for gctba.a. * NT_MAKEFILE (all): Add dependency on gctba.lib. * WCC_MAKEFILE (all): Likewise. * README.QUICK: Update information about "make c++" (reference libgctba.a, libgctba.so and doc/gcinterface.md). * configure.ac (throw-bad-alloc-library): Specify new AC_ARG_ENABLE. * configure.ac (GC_TBA_LIBRARY): New AM_CONDITIONAL. * doc/gcinterface.md (Class inheritance based interface): Add information about libgctba library; document GC_NEW_ABORTS_ON_OOM and GC_INCLUDE_NEW macros.