summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Update ChangeLog file (v8.0 changes)release-8_0Ivan Maidanski2023-04-291-0/+6
|
* Update ChangeLog file (v7.2 - v7.4 changes only)Ivan Maidanski2023-04-291-0/+4
|
* Fix missing extern C for __asan_default_optionsIvan Maidanski2023-04-281-0/+4
| | | | | | | | | | (fix of commit 84b695d01) Issue #206 (bdwgc). * os_dep.c [ADDRESS_SANITIZER && (UNIX_LIKE || NEED_FIND_LIMIT || MPROTECT_VDB) && !CUSTOM_ASAN_DEF_OPTIONS] (__asan_default_options): Add the declaration wrapped into EXTERN_C_BEGIN.
* Fix infinite loop in disable_gc_for_dlopen and GC_wait_for_gc_completionIvan Maidanski2023-04-282-7/+10
| | | | | | | | | | | | | (a cherry-pick of commit 2dff48cb3 from 'release-8_2') Issue #257 (bdwgc). * alloc.c (GC_collect_a_little_inner): Call GC_mark_some() (in a loop) even if GC_dont_gc. * alloc.c (GC_collect_a_little, GC_allocobj): Do not call GC_collect_a_little_inner() if GC_dont_gc. * tests/test.c (check_heap_stats): Do not call GC_collect_a_little() (repeatedly) if GC_is_disabled().
* Ensure 'new' system header is included by gc_cpp.h if GC_INCLUDE_NEWIvan Maidanski2023-04-281-1/+4
| | | | | | | | (a cherry-pick of commit d1bc109ec from 'master') * include/gc_cpp.h [GC_INCLUDE_NEW]: Include <new> right after include gc.h (regardless of GC_NEW_ABORTS_ON_OOM and _LIBCPP_NO_EXCEPTIONS).
* Fix description of client promise for IGNORE_OFF_PAGE allocated objectsIvan Maidanski2023-04-288-21/+23
| | | | | | | | | | | | | | | | | | | | | | | | | (a cherry-pick of commit d1aa5274a from 'release-8_2') The client should keep a pointer within the first heap block for such an allocated object. Previously, it was mentioned in the documentation and comments that such a pointer should be within the first 256 or 512 bytes. * README.md (The C Interface to the Allocator): Fix the description (comment) of GC_malloc_ignore_off_page (the client promises to keep a pointer within the first hblk of the object instead of 256 or 512 bytes, or a page). * doc/gcinterface.md (GC_MALLOC_IGNORE_OFF_PAGE): Likewise. * doc/gc.man (GC_malloc_atomic_ignore_off_page): Likewise. * include/gc.h (GC_malloc_ignore_off_page): Likewise. * include/gc_mark.h (GC_generic_malloc_ignore_off_page): Likewise. * include/private/gc_priv.h (IGNORE_OFF_PAGE): Likewise. * include/private/gc_priv.h [DBG_HDRS_ALL || GC_GCJ_SUPPORT || !GC_NO_FINALIZATION] (GC_generic_malloc_inner_ignore_off_page): Likewise. * malloc.c [DBG_HDRS_ALL || GC_GCJ_SUPPORT || !GC_NO_FINALIZATION] (GC_generic_malloc_inner_ignore_off_page): Likewise. * include/gc_gcj.h (GC_gcj_malloc_ignore_off_page): Refine comment.
* Invoke GC_oom_fn if GC_make_array_descriptor failed because of no memoryIvan Maidanski2023-04-281-1/+2
| | | | | | | (a cherry-pick of commit 223ce4fdf from 'master') * typd_mlc.c (GC_calloc_explicitly_typed): If descr_type is NO_MEM then return the result of GC_get_oom_fn()(lb) instead of NULL.
* Do not prohibit zero proc argument in GC_register_disclaim_procIvan Maidanski2023-04-283-2/+2
| | | | | | | | | | | (a cherry-pick of commit d4c4a7ba5 from 'master') * fnlz_mlc.c [ENABLE_DISCLAIM] (GC_register_disclaim_proc): Do not check that proc is non-zero. * include/gc_disclaim.h (GC_register_disclaim_proc): Remove GC_ATTR_NONNULL(2) attribute. * reclaim.c [ENABLE_DISCLAIM] (GC_disclaim_and_reclaim): Add assertion that disclaim is non-zero.
* Fix null pointer dereference in TRACE_TARGETIvan Maidanski2023-04-281-1/+2
| | | | | * include/private/gc_pmark.h [ENABLE_TRACE] (TRACE_TARGET): Do not dereference GC_trace_addr if it is not a pointer to a heap object.
* Increment allocated objects count after GC_GCJ_MALLOC() in gctestIvan Maidanski2023-04-281-0/+1
| | | | | | | (a cherry-pick of commit 4d83569d5 from 'master') * tests/test.c [GC_GCJ_SUPPORT] (gcj_cons): Increment collectable_count.
* Fix of GC_bytes_allocd increment in GC_generic_malloc_innerIvan Maidanski2023-04-281-3/+5
| | | | | | | | | | | EXTRA_BYTES should be always counted when updating GC_bytes_allocd. * malloc.c (GC_generic_malloc_inner): Define lb_adjusted local variable and set it to ADD_SLOP(lb); increment GC_bytes_allocd by lb_adjusted instead of lb (in case of a non-small object). * malloc.c [DBG_HDRS_ALL || GC_GCJ_SUPPORT || !GC_NO_FINALIZATION] (GC_generic_malloc_inner_ignore_off_page): Change type of lb_adjusted local variable from word to size_t.
* Fix old function name in comment of GC_finalized_disclaimIvan Maidanski2023-04-281-1/+1
| | | | | | | (fix of commit 6c1a92445) * fnlz_mlc.c [ENABLE_DISCLAIM] (GC_finalized_disclaim): Fix old function name in comment ("GC_disclaim_and_reclaim").
* Remove misleading comment in GC_obj_kinds for AUNCOLLECTABLE kindIvan Maidanski2023-04-281-1/+1
| | | | | | * mark.c [GC_ATOMIC_UNCOLLECTABLE] (GC_obj_kinds): Remove misleading comment ("add length to descr") for FALSE value (for ok_relocate_descr field).
* Fix a typo in comment of GC_generic_malloc_innerIvan Maidanski2023-04-281-1/+1
| | | | | * malloc.c (GC_generic_malloc_inner): Fix a typo ("to directly allocate") in comment.
* Fix mistyped GC_register_finalizer[_unreachable] in commentsIvan Maidanski2023-04-282-2/+2
| | | | | | | | (a cherry-pick of commit a04c55a5b from 'master') * dbg_mlc.c (store_old): Fix name in comment ("GC_register_finalizer"). * include/gc.h (GC_java_finalization): Fix name in comment ("GC_register_finalizer_unreachable").
* Fix CORD_next() indent inside loops in test_basics() of cordtestIvan Maidanski2023-04-281-1/+1
| | | | | * cord/tests/cordtest.c (test_basics): Adjust indentation of CORD_next() call inside while loop.
* .gitignore: Add 'configure~' fileIvan Maidanski2023-04-281-0/+1
|
* Update ChangeLog file (v8.0 changes)Ivan Maidanski2023-03-151-0/+2
|
* Update ChangeLog file (v7.2 - v7.4 changes only)Ivan Maidanski2023-03-151-2/+8
|
* Do not pass GC_malloc result to GC_size w/o checking in gctestIvan Maidanski2023-03-151-1/+1
| | | | | | | (a cherry-pick of commit 923a30202 from 'master') * tests/test.c (run_one_test): Do not call GC_malloc(0) inside GC_printf argument.
* Fix GC_thread_is_registered for finished threadsIvan Maidanski2023-03-143-2/+4
| | | | | | | | | | | | | | | (a cherry-pick of commit 5a8c02852 from 'master') A finished thread may still stay in GC_threads, but it is no longer considered during a garbage collection phase, thus GC_thread_is_registered() should return false in such a case. * include/gc.h [GC_THREADS] (GC_thread_is_registered): Refine comment (describe the case when the thread is marked as finished). * pthread_support.c (GC_thread_is_registered): Return FALSE if me->flags&FINISHED. * win32_threads.c (GC_thread_is_registered): Return FALSE if KNOWN_FINISHED(me).
* Do not mix debug and non-debug allocations in disclaim testsIvan Maidanski2023-03-143-10/+11
| | | | | | | | | | | | | | | | | (a cherry-pick of commit 30d32b4e9 from 'master') * include/gc_disclaim.h (GC_finalized_malloc): Add comment that the debugging version of the function is missing. * tests/disclaim_bench.c (testobj_new): Use GC_malloc() instead of GC_NEW(). * tests/disclaim_weakmap_test.c (weakmap_add, weakmap_new): Likewise. * tests/disclaim_bench.c (testobj_new): Use GC_register_finalizer_no_order() instead of GC_REGISTER_FINALIZER_NO_ORDER(). * tests/disclaim_bench.c (main): Use GC_malloc() instead of GC_MALLOC(). * tests/weakmap.c (weakmap_add, weakmap_new): Use GC_ptr_store_and_dirty() instead of GC_PTR_STORE_AND_DIRTY().
* Fix a typo in comment of GC_start_rtn_prepare_threadIvan Maidanski2023-03-141-1/+1
| | | | | | | (a cherry-pick of commit 1a8160ea8 from 'master') * pthread_support.c (GC_start_rtn_prepare_thread): Fix a typo in comment ("used in").
* Ensure GC_NO_PTHREAD_SIGMASK defined if no GC_pthread_sigmask prototypeIvan Maidanski2023-03-141-0/+2
| | | | | | | | | (a cherry-pick of commit 272e61e46 from 'master') * include/gc_pthread_redirects.h [!GC_PTHREAD_REDIRECTS_ONLY && !GC_NO_PTHREAD_SIGMASK && !(GC_PTHREAD_SIGMASK_NEEDED || _BSD_SOURCE || _GNU_SOURCE || _POSIX_C_SOURCE>=199506L || _XOPEN_SOURCE>=500)] (GC_NO_PTHREAD_SIGMASK): Define macro.
* Fix potential SIGSEGV on out-of-memory in gctestIvan Maidanski2023-03-141-11/+26
| | | | | | | | | | (a cherry-pick of commit 051f57762 from 'master') * tests/test.c (test_generic_malloc_or_special): Call CHECK_OUT_OF_MEMORY() before GC_get_kind_and_size(). * tests/test.c [DBG_HDRS_ALL] (run_one_test): Set y to fail_proc1 right before its use; call CHECK_OUT_OF_MEMORY() before each GC_size() invocation; call CHECK_OUT_OF_MEMORY() before GC_base().
* Fix joinable threads shutdown on NaClIvan Maidanski2023-03-141-6/+8
| | | | | | | | | | | | | | | | | | | (a cherry-pick of commit a6cd81cbd from 'master') GC_nacl_shutdown_gc_thread() should be called (and value of GC_nacl_gc_thread_self should be cleared) on thread termination even for non-detached threads. Thus, GC_nacl_initialize_gc_thread() should be called (and value of GC_nacl_gc_thread_self should be set) additionally if the thread is registered from its destructor. * pthread_support.c [NACL] (GC_delete_thread): Do not call GC_nacl_shutdown_gc_thread() and do not clear GC_nacl_gc_thread_self. * pthread_support.c [NACL] (GC_unregister_my_thread_inner): Call GC_nacl_shutdown_gc_thread() and clear value of GC_nacl_gc_thread_self (after GC_destroy_thread_local). * pthread_support.c [NACL] (GC_register_my_thread): If KNOWN_FINISHED then set GC_nacl_gc_thread_self to me and call GC_nacl_initialize_gc_thread().
* Fix unregistering of thread created by intercepted pthread_create on NaClIvan Maidanski2023-03-141-3/+5
| | | | | | | (a cherry-pick of commit ee779ffc5 from 'master') * pthread_start.c [GC_PTHREADS && !GC_WIN32_THREADS && NACL] (GC_pthread_start_inner): Call GC_thread_exit_proc(me) before return.
* Update AUTHORS file (add Amaury Sechet)Ivan Maidanski2023-03-141-0/+1
|
* Fix one more typo in scale.mdAmaury Sechet2023-03-141-1/+1
| | | | | * docs/scale.md (The Parallel Marking Algorithm): Fix a typo ("our approach").
* Fix typo in 'STATIC' word in ChangeLogIvan Maidanski2023-03-141-1/+1
| | | | * ChangeLog (7.0alpha9): Fix a typo ("STATIC").
* Fix a typo in GC_register_data_segments comment (MacOS)Ivan Maidanski2023-03-141-1/+1
| | | | | | | * os_dep.c [!OS2 && !MSWIN32 && !MSWINCE && !CYGWIN32 && !AMIGA && !OPENBSD && !PCR && MACOS && !THINK_C && __MWERKS__ && !__POWERPC__ && __option(far_data)] (GC_register_data_segments): Fix typo in comment ("the").
* Fix store-and-dirty call in GC_CONSIvan Maidanski2023-03-141-1/+2
| | | | | | | | | | | | | | (a cherry-pick of commit f6befb64d from 'master') GC_PTR_STORE_AND_DIRTY() might be expanded to a debugging version of the store-and-dirty function, thus the former should not be used for pointers returned from the non-debugging version of a GC allocation routine like GC_FAST_MALLOC_GRANS(). * include/gc_inline.h: Add comment that the debugging version of this API is missing. * include/gc_inline.h (GC_CONS): Use GC_ptr_store_and_dirty() instead of GC_PTR_STORE_AND_DIRTY().
* Fix DCL_LOCK_STATE placement in GC_set_oom_fnIvan Maidanski2023-03-141-1/+2
| | | | | | (fix of commit c7047ca9e) * misc.c (GC_set_oom_fn): Move GC_ASSERT() to be after DCL_LOCK_STATE.
* Fix typos in comments and documentation (regarding 'it is')Ivan Maidanski2023-03-147-7/+7
| | | | | | | | | | | | | | (a cherry-pick of commit 25aa62fee from 'master') * ChangeLog (4.3): Fix typo ("it's"). * doc/platforms/README.amiga (GC_AMIGA_GC): Likewise. * extra/AmigaOS.c (GC_amiga_allocwrapper_any): Fix typo in comment ("it's"). * malloc.c (GC_free): Likewise. * new_hblk.c (GC_build_fl): Likewise. * os_dep.c [DATASTART_USES_BSDGETDATASTART] (GC_FreeBSDGetDataStart): Likewise. * reclaim.c (GC_start_reclaim): Likewise.
* Fix mistyped GC_free_inner in comment of GC_remove_all_threads_but_meIvan Maidanski2023-03-142-3/+3
| | | | | | | | | | | (a cherry-pick of commit 05b220b98 from 'master') * pthread_support.c [CAN_HANDLE_FORK && (GC_DARWIN_THREADS || THREAD_LOCAL_ALLOC && !USE_CUSTOM_SPECIFIC)] (GC_remove_all_threads_but_me): Rename GC_free_internal to GC_free_inner in comments. * win32_threads.c [CAN_HANDLE_FORK && THREAD_LOCAL_ALLOC && !USE_CUSTOM_SPECIFIC] (GC_remove_all_threads_but_me): Likewise.
* Fix typo in GC_allochblk_nth nameIvan Maidanski2023-03-142-2/+2
| | | | | | | | (a cherry-pick of commit c716d77bd from 'release-8_2') * ChangeLog: Fix typo ("GC_allochblk_nth"). * include/private/gc_priv.h (GC_alloc_large): Fix typo in comment ("GC_allochblk_nth").
* Eliminate 'cast signed to bigger unsigned' CSA warning in GC_new_threadIvan Maidanski2023-03-141-1/+1
| | | | | | | (a cherry-pick of commit 99a571390 from 'master') * pthread_support.c [CPPCHECK && THREAD_SANITIZER] (GC_new_thread): Cast result->dummy[0] to unsigned char.
* Update ChangeLog file (v8.0 changes)Ivan Maidanski2022-11-161-0/+12
|
* Update ChangeLog file (v7.6 changes)Ivan Maidanski2022-11-161-0/+8
| | | | (a cherry-pick of commit 4fe277030 from 'release-7_6')
* Update ChangeLog file (v7.2 - v7.4 changes only)Ivan Maidanski2022-11-161-0/+22
| | | | (a cherry-pick of commit ec801e0ef from 'release-7_4')
* Fix mistyped function name in documentation of REDIRECT_REALLOCIvan Maidanski2022-11-141-1/+1
| | | | | * doc/README.macros (REDIRECT_REALLOC): Fix typo ("realloc" w/o GC_ prefix).
* Fix data race in GC_heapsize_at_forced_unmap variableIvan Maidanski2022-11-141-6/+9
| | | | | | | | | | | | | | | | | | | (a cherry-pick of commit 856760844 from 'release-8_2') Issue #488 (bdwgc). Write to GC_heapsize_at_forced_unmap should be only performed when holding the allocation lock. * alloc.c (GC_heapsize_at_forced_unmap): Move the definition upper to be before GC_try_to_collect_general(); add comment. * alloc.c (GC_try_to_collect_general): Set GC_heapsize_at_forced_unmap value (after LOCK) if force_unmap; move comment from GC_heapsize_at_forced_unmap(). * alloc.c (GC_try_to_collect_general): Remove GC_ATTR_UNUSED for force_unmap. * alloc.c (GC_gcollect_and_unmap): Do not set GC_heapsize_at_forced_unmap.
* Eliminate 'cast signed to bigger unsigned' CSA warning in WARN callsIvan Maidanski2022-11-141-1/+2
| | | | | | (a cherry-pick of commit 99536f178 from 'release-8_2') * pthread_support.c (GC_thr_init): Cast WARN argument to signed_word.
* Fix use of unset errno after pthread_sigmask callsIvan Maidanski2022-11-142-10/+5
| | | | | | | | | | (a cherry-pick of commit e55d1b99b from 'release-8_2') * pthread_support.c [PARALLEL_MARK] (GC_start_mark_threads_inner): Do not pass errno value to WARN() calls (because pthread_create and pthread_sigmask do not set errno). * win32_threads.c [PARALLEL_MARK && GC_PTHREADS_PARAMARK && !NO_MARKER_SPECIAL_SIGMASK] (GC_start_mark_threads_inner): Likewise.
* Fix missing libalphagc.so dependency in Makefile.directIvan Maidanski2022-11-141-2/+2
| | | | | | | (a cherry-pick of commit 397e06470 from 'master') * Makefile.direct (OBJS): Add comment. * Makefile.direct (libalphagc.so): Add dependency on dyn_load.o.
* Fix double initialization of main thread local free lists on Win32Ivan Maidanski2022-11-141-12/+12
| | | | | | | | | | | | (a cherry-pick of commit 4b101ee06 from 'release-8_2') * win32_threads.c [THREAD_LOCAL_ALLOC] (GC_register_my_thread_inner): Update comment; do not call GC_init_thread_local(). * win32_threads.c [THREAD_LOCAL_ALLOC] (GC_register_my_thread): Call GC_init_thread_local() both after GC_register_my_thread_inner() and GC_record_stack_base() calls (in case of return GC_SUCCESS). * win32_threads.c [GC_PTHREADS && THREAD_LOCAL_ALLOC] (GC_pthread_start_inner): Call GC_init_thread_local().
* Fix disabling of automatic dynamic libraries registrationIvan Maidanski2022-11-141-3/+4
| | | | | | | | | | | | (a cherry-pick of commit 0d19067c3 from 'master') Now, if GC_no_dls then GC_is_visible does not cause registration of dynamic libraries. * ptr_chck.c [!THREADS && (DYNAMIC_LOADING || MSWIN32 || MSWINCE || CYGWIN32 || PCR)] (GC_is_visible): Do not call GC_register_dynamic_libraries() followed by GC_is_static_root() if GC_no_dls.
* Abort with appropriate message if first call of mmap fails with EPERMIvan Maidanski2022-11-141-1/+2
| | | | | | | | | | | | | (fix of commit 1c62b365b) This is observed on Linux, at least. * os_dep.c [!OS2 && !PCR && !AMIGA && !USE_WINALLOC && !MACOS && !DOS4GW && !NINTENDO_SWITCH && !NONSTOP && !SN_TARGET_ORBIS && !SN_TARGET_PS3 && !SN_TARGET_PSP2 && !RTEMS && !__CC_ARM && MMAP_SUPPORTED && !MSWIN_XBOX1] (GC_unix_mmap_get_mem): Call ABORT() if allocation failed and GC_pages_executable and last_addr==HEAP_START and errno is EPERM.
* Fix missing result check of pthread_attr_getdetachstate in pthread_createIvan Maidanski2022-11-142-8/+6
| | | | | | | | | * pthread_support.c (pthread_create): Call ABORT() if pthread_attr_getdetachstate() has failed. * win32_threads.c [GC_PTHREADS] (GC_pthread_create): Likewise. * win32_threads.c [GC_PTHREADS] (start_info.detached): Change type from GC_bool to int (to match the type of the 2nd argument of pthread_attr_getdetachstate).
* Fix missing lock while updating GC_in_thread_creation in GC_exit_checkIvan Maidanski2022-11-141-3/+11
| | | | | | | | (fix of commit 8e6460052) * misc.c [!DONT_USE_ATEXIT && THREADS] (GC_exit_check): Wrap each update of GC_in_thread_creation into LOCK/UNLOCK (but not GC_gcollect call); add comment.