summaryrefslogtreecommitdiff
path: root/gc_cpp.cc
Commit message (Collapse)AuthorAgeFilesLines
* Provide global non-throwing operator new/delete in gccpp libraryIvan Maidanski2023-04-201-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note: this might require define GC_INCLUDE_NEW by client before include gc_cpp.h on Windows hosts (to have nothrow_t declared before the global inline operator new and delete are defined). * gc_cpp.cc [(!_MSC_VER && !__DMC__ || GC_NO_INLINE_STD_NEW) && !GC_INLINE_STD_NEW && GC_OPERATOR_NEW_NOTHROW] (operator new, operator delete): Define with nothrow_t argument. * gc_cpp.cc [(!_MSC_VER && !__DMC__ || GC_NO_INLINE_STD_NEW) && !GC_INLINE_STD_NEW && GC_OPERATOR_NEW_ARRAY && !CPPCHECK && GC_OPERATOR_NEW_NOTHROW] (operator new[], operator delete[]): Likewise. * include/gc/gc_cpp.h [GC_INLINE_STD_NEW && GC_OPERATOR_NEW_ARRAY && GC_OPERATOR_NEW_NOTHROW] (operator new[], operator delete[]): Likewise. * include/gc/gc_cpp.h [GC_INLINE_STD_NEW && GC_OPERATOR_NEW_NOTHROW] (operator new, operator delete): Likewise. * include/gc/gc_cpp.h [!GC_OPERATOR_NEW_NOTHROW && !GC_NO_OPERATOR_NEW_NOTHROW && (GC_INCLUDE_NEW && (__cplusplus>=201103L || _MSVC_LANG>=201103L) || __NOTHROW_T_DEFINED)] (GC_OPERATOR_NEW_NOTHROW): Define macro; add comment. * include/gc/gc_cpp.h [!GC_INLINE_STD_NEW && GC_NO_INLINE_STD_NEW && _MSC_VER && GC_OPERATOR_NEW_ARRAY && GC_OPERATOR_NEW_NOTHROW] (operator new[], operator delete[]): Add prototype with nothrow_t argument (with commented out GC_ATTR_MALLOC). * include/gc/gc_cpp.h [!GC_INLINE_STD_NEW && GC_NO_INLINE_STD_NEW && _MSC_VER && GC_OPERATOR_NEW_NOTHROW] (operator new, operator delete): Likewise.
* Define sized delete operator in 'gc' classIvan Maidanski2023-04-201-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gc_cpp.cc [!_MSC_VER && !__DMC__ || GC_NO_INLINE_STD_NEW] (operator delete): Replace __cplusplus>=201703L||_MSVC_LANG>=201703L to defined(GC_OPERATOR_SIZED_DELETE). * include/gc/gc_cpp.h [GC_INLINE_STD_NEW]: Likewise. * gc_cpp.cc [!_MSC_VER && !__DMC__ || GC_NO_INLINE_STD_NEW] (GC_ALLOCATOR_THROW_OR_ABORT, operator new, operator delete, operator new[], operator delete[]): Do not define if GC_INLINE_STD_NEW. * gc_cpp.cc (operator new, operator delete): Reformat code. * include/gc/gc_cpp.h [!GC_NO_INLINE_STD_NEW && !GC_INLINE_STD_NEW && (_MSC_VER || __DMC__ || (__BORLANDC__ || __CYGWIN__ || __CYGWIN32__ || __MINGW32__ || __WATCOMC__) && !GC_BUILD && !GC_NOT_DLL)] (GC_INLINE_STD_NEW): Define macro. * include/gc/gc_cpp.h [!GC_NO_OPERATOR_SIZED_DELETE && !GC_OPERATOR_SIZED_DELETE && (__cplusplus>=201402L || _MSVC_LANG>=201402L)] (GC_OPERATOR_SIZED_DELETE): Likewise. * include/gc/gc_cpp.h [!GC_NO_INLINE_STD_NEW && (_MSC_VER || __DMC__ || (__BORLANDC__ || __CYGWIN__ || __CYGWIN32__ || __MINGW32__ || __WATCOMC__) && !GC_BUILD && !GC_NOT_DLL)]: Check GC_INLINE_STD_NEW instead. * include/gc/gc_cpp.h [GC_OPERATOR_SIZED_DELETE] (gc::operator delete(void*,GC_SIZE_T)): Declare. * include/gc/gc_cpp.h [GC_OPERATOR_NEW_ARRAY && GC_OPERATOR_SIZED_DELETE] (gc::operator delete[](void*,GC_SIZE_T)): Likewise. * include/gc/gc_cpp.h [GC_NO_INLINE_STD_NEW && _MSC_VER && GC_OPERATOR_NEW_ARRAY && GC_OPERATOR_SIZED_DELETE] (operator delete[](void*,GC_SIZE_T)): Likewise. * include/gc/gc_cpp.h [GC_NO_INLINE_STD_NEW && _MSC_VER && GC_OPERATOR_SIZED_DELETE] (operator delete(void*,GC_SIZE_T)): Likewise. * include/gc/gc_cpp.h [GC_OPERATOR_SIZED_DELETE] (gc::operator delete(void*,GC_SIZE_T)): Define inline function. * include/gc/gc_cpp.h [GC_OPERATOR_NEW_ARRAY && GC_OPERATOR_SIZED_DELETE] (gc::operator delete[](void*,GC_SIZE_T)): Likewise.
* Fix 'C++17 does not allow dynamic exc spec' warn if GC_NO_INLINE_STD_NEWIvan Maidanski2023-04-191-12/+3
| | | | | | | | | | | | | | | | | | | | (fix of commit 17364f061) * gc_cpp.cc: Do not include <new> directly. * gc_cpp.cc [!GC_INCLUDE_NEW] (GC_INCLUDE_NEW): Define macro. * gc_cpp.cc (GC_DECL_NEW_THROW): Move definition to gc_cpp.h. * include/gc/gc_cpp.h [!GC_NO_INLINE_STD_NEW && (_MSC_VER || __DMC__ || (__BORLANDC__ || __CYGWIN__ || __CYGWIN32__ || __MINGW32__ || __WATCOMC__) && !GC_BUILD && !GC_NOT_DLL)] (GC_DECL_INLINE_NEW_THROW): Do not define. * include/gc/gc_cpp.h [GC_NEW_DELETE_NEED_THROW && !(__cplusplus>=201703L || _MSVC_LANG>=201703L) && !GC_INCLUDE_NEW] (GC_DECL_NEW_THROW): Define to empty. * include/gc/gc_cpp.h [!GC_NO_INLINE_STD_NEW && (_MSC_VER || __DMC__ || (__BORLANDC__ || __CYGWIN__ || __CYGWIN32__ || __MINGW32__ || __WATCOMC__) && !GC_BUILD && !GC_NOT_DLL)] (operator new, operator new[]): Replace GC_DECL_INLINE_NEW_THROW attribute to GC_DECL_NEW_THROW.
* Fix 'size_t not found in namespace std' dmc error in gc_allocator.hIvan Maidanski2023-04-171-6/+6
| | | | | | | | | | | | | | | | | | | | | (fix of commit 08eb0da6f) * gc_cpp.cc (operator new, operator delete): Use GC_SIZE_T instead of std::size_t. * include/gc/gc_allocator.h (GC_ALCTR_PTRDIFF_T, GC_ALCTR_SIZE_T): Define macro (and undefine it at the end of file). * include/gc/gc_allocator.h (GC_selective_alloc, gc_allocator.size_type, gc_allocator.max_size, gc_allocator_ignore_off_page.size_type, gc_allocator_ignore_off_page.max_size, traceable_allocator.size_type, traceable_allocator.max_size): Use GC_ALCTR_SIZE_T instead of std::size_t. * include/gc/gc_allocator.h (gc_allocator.difference_type, gc_allocator_ignore_off_page.difference_type, traceable_allocator.difference_type): Use GC_ALCTR_PTRDIFF_T instead of std::ptrdiff_t. * include/gc/gc_cpp.h [GC_INCLUDE_NEW] (GC_PTRDIFF_T, GC_SIZE_T): Do not use std:: prefix unless __cplusplus>=201103L.
* Fix 'operator new is missing throw(bad_alloc)' clang warning in gc_cpp.hIvan Maidanski2023-04-171-7/+1
| | | | | | | | | | | | | | | | | The warning was reported on Window and only if __cplusplus < 201103L. * gc_cpp.cc [GC_NEW_DELETE_THROW_NOT_NEEDED && !GC_NEW_DELETE_NEED_THROW && GC_GNUC_PREREQ(4,2) && (__cplusplus<201103L || __clang__)] (GC_NEW_DELETE_NEED_THROW): Move definition to gc_cpp.h. * include/gc/gc_cpp.h [!GC_NO_INLINE_STD_NEW && (_MSC_VER || __DMC__ || (__BORLANDC__ || __CYGWIN__ || __CYGWIN32__ || __MINGW32__ || __WATCOMC__) && !GC_BUILD && !GC_NOT_DLL)] (GC_DECL_INLINE_NEW_THROW): New macro. * include/gc/gc_cpp.h [!GC_NO_INLINE_STD_NEW && (_MSC_VER || __DMC__ || (__BORLANDC__ || __CYGWIN__ || __CYGWIN32__ || __MINGW32__ || __WATCOMC__) && !GC_BUILD && !GC_NOT_DLL)] (operator new): Add GC_DECL_INLINE_NEW_THROW attribute.
* Prefix size_t and ptrdiff_t with namespace 'std' in C++ filesIvan Maidanski2023-04-171-25/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note: this affects gc_cpp.h only if GC_INCLUDE_NEW is defined (i.e. "new" header is included). * gc_cpp.cc (operator new, operator delete): Use std::size_t instead of size_t. * include/gc/gc_allocator.h (GC_selective_alloc, gc_allocator.size_type, gc_allocator.max_size, gc_allocator_ignore_off_page.size_type, gc_allocator_ignore_off_page.max_size, traceable_allocator.size_type, traceable_allocator.max_size): Likewise. * gc_cpp.cc (operator delete): Remove name of unused argument (and cast to void). * include/gc/gc_cpp.h (operator new, operator delete): Likewise. * gc_cpp.cc: Reformat code. * include/gc/gc_cpp.h: Likewise. * include/gc/gc_allocator.h (gc_allocator.difference_type, gc_allocator_ignore_off_page.difference_type, traceable_allocator.difference_type): Use std::ptrdiff_t instead of ptrdiff_t. * include/gc/gc_cpp.h (GC_PTRDIFF_T, GC_SIZE_T): New macro (depending on GC_INCLUDE_NEW). * include/gc/gc_cpp.h (operator new, operator delete): Use GC_SIZE_T instead of size_t. * include/gc/gc_cpp.h (gc_cleanup): Reformat comments. * include/gc/gc_cpp.h (gc_cleanup::cleanup): Use GC_PTRDIFF_T instead of ptrdiff_t. * include/gc/gc_cpp.h [!GC_NO_INLINE_STD_NEW && _MSC_VER] (operator new): Remove duplicate code.
* Include gc/gc[_cpp].h directly except for cord and testsIvan Maidanski2022-09-141-2/+2
| | | | | | | | | | | | | | | (refactoring) * extra/msvc_dbg.c [!_M_ARM && !_M_ARM64 && !_M_X64 && _MSC_VER]: Include "gc/gc.h" instead of "gc.h". * gc_badalc.cc: Likewise. * gc_cpp.cc: Likewise. * include/private/gc_alloc_ptrs.h: Likewise. * include/private/gc_atomic_ops.h [GC_BUILTIN_ATOMIC]: Likewise. * include/private/gc_priv.h [!GC_H]: Likewise. * gc_cpp.cc: Include "gc/gc_cpp.h" instead of "gc_cpp.h". * include/private/gcconfig.h: Change include gc.h to include gc/gc.h in comment.
* Remove extra space after comma in license termsIvan Maidanski2022-05-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (reformatting) * CMakeLists.txt: Remove an extra space after comma in license header comment. * Makefile.am: Likewise. * allchblk.c: Likewise. * alloc.c: Likewise. * backgraph.c: Likewise. * blacklst.c: Likewise. * checksums.c: Likewise. * configure.ac: Likewise. * cord/cordbscs.c: Likewise. * cord/cordprnt.c: Likewise. * cord/cordxtra.c: Likewise. * cord/tests/cordtest.c: Likewise. * cord/tests/de.c: Likewise. * cord/tests/de_cmds.h: Likewise. * cord/tests/de_win.c: Likewise. * cord/tests/de_win.h: Likewise. * cord/tests/de_win.rc: Likewise. * darwin_stop_world.c: Likewise. * dbg_mlc.c: Likewise. * dyn_load.c: Likewise. * extra/gc.c: Likewise. * extra/msvc_dbg.c: Likewise. * extra/pcr_interface.c: Likewise. * extra/real_malloc.c: Likewise. * finalize.c: Likewise. * fnlz_mlc.c: Likewise. * gc_badalc.cc: Likewise. * gc_cpp.cc: Likewise. * gc_dlopen.c: Likewise. * gcj_mlc.c: Likewise. * headers.c: Likewise. * include/gc/cord.h: Likewise. * include/gc/cord_pos.h: Likewise. * include/gc/ec.h: Likewise. * include/gc/gc.h: Likewise. * include/gc/gc_backptr.h: Likewise. * include/gc/gc_config_macros.h: Likewise. * include/gc/gc_disclaim.h: Likewise. * include/gc/gc_gcj.h: Likewise. * include/gc/gc_inline.h: Likewise. * include/gc/gc_mark.h: Likewise. * include/gc/gc_pthread_redirects.h: Likewise. * include/gc/gc_tiny_fl.h: Likewise. * include/gc/gc_typed.h: Likewise. * include/gc/gc_version.h: Likewise. * include/gc/javaxfc.h: Likewise. * include/gc/leak_detector.h: Likewise. * include/include.am: Likewise. * include/private/darwin_semaphore.h: Likewise. * include/private/darwin_stop_world.h: Likewise. * include/private/dbg_mlc.h: Likewise. * include/private/gc_alloc_ptrs.h: Likewise. * include/private/gc_atomic_ops.h: Likewise. * include/private/gc_hdrs.h: Likewise. * include/private/gc_locks.h: Likewise. * include/private/gc_pmark.h: Likewise. * include/private/gc_priv.h: Likewise. * include/private/gcconfig.h: Likewise. * include/private/pthread_stop_world.h: Likewise. * include/private/pthread_support.h: Likewise. * include/private/specific.h: Likewise. * include/private/thread_local_alloc.h: Likewise. * m4/gc_set_version.m4: Likewise. * mach_dep.c: Likewise. * malloc.c: Likewise. * mallocx.c: Likewise. * mark.c: Likewise. * mark_rts.c: Likewise. * misc.c: Likewise. * new_hblk.c: Likewise. * obj_map.c: Likewise. * os_dep.c: Likewise. * pthread_start.c: Likewise. * pthread_stop_world.c: Likewise. * pthread_support.c: Likewise. * ptr_chck.c: Likewise. * reclaim.c: Likewise. * specific.c: Likewise. * tests/atomicops.c: Likewise. * tests/cpp.cc: Likewise. * tests/disclaim.c: Likewise. * tests/disclaim_bench.c: Likewise. * tests/gctest.c: Likewise. * tests/tests.am: Likewise. * tests/weakmap.c: Likewise. * thread_local_alloc.c: Likewise. * tools/setjmp_t.c: Likewise. * tools/threadlibs.c: Likewise. * typd_mlc.c: Likewise. * win32_threads.c: Likewise. * LICENSE: Remove an extra space after comma in license terms.
* Fix copyright message in de_win.rc and gc_cpp.ccIvan Maidanski2020-09-031-2/+5
| | | | | | | | | | Issue #331 (bdwgc). The copyright message in these 2 files was different from the BDWGC default one (e.g. see that in malloc.c) by a mistake. * cord/tests/de_win.rc: Alter copyright to match that of de_win.c. * gc_cpp.cc: Alter copyright to match that of gc_cpp.h.
* Move C++ GC_ATTR_EXPLICIT and GC_NOEXCEPT definition to gc_config_macros.hIvan Maidanski2020-04-161-1/+1
| | | | | | | | | | | | | | | | (code refactoring) * gc_badalc.cc: Do not include gc_cpp.h. * gc_cpp.cc: Remove GC_NOEXCEPT in comment for an include. * include/gc_allocator.h [!GC_ATTR_EXPLICIT] (GC_ATTR_EXPLICIT): Do not define. * include/gc_allocator.h [!GC_NOEXCEPT] (GC_NOEXCEPT): Likewise. * include/gc_cpp.h [!GC_NOEXCEPT] (GC_NOEXCEPT): Likewise. * tests/test_cpp.cc [!GC_ATTR_EXPLICIT] (GC_ATTR_EXPLICIT): Likewise. * include/gc_config_macros.h [__cplusplus && !GC_ATTR_EXPLICIT] (GC_ATTR_EXPLICIT): Define macro (moved from gc_allocator.h). * include/gc_config_macros.h [__cplusplus && !GC_NOEXCEPT] (GC_NOEXCEPT): Likewise.
* Check _MSVC_LANG macro in addition to __cplusplus (MS VC)Ivan Maidanski2020-04-151-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #314 (bdgwc). MS VC defines __cplusplus to 199711L by default (unless /Zc:__cplusplus is passed to the compiler). * gc_cpp.cc [GC_NEW_DELETE_NEED_THROW && _MSVC_LANG>=201703] (GC_DECL_NEW_THROW): Define to noexcept(false) instead of throw(bad_alloc). * gc_cpp.cc [!_MSC_VER && !__DMC__ || GC_NO_INLINE_STD_NEW]: Change __cplusplus>201103 to __cplusplus>=201402. * include/gc_cpp.h [!GC_NO_INLINE_STD_NEW && (_MSC_VER || __DMC__ || (__BORLANDC__ || __CYGWIN__ || __CYGWIN32__ || __MINGW32__ || __WATCOMC__) && !GC_BUILD && !GC_NOT_DLL)]: Likewise. * gc_cpp.cc [(!_MSC_VER && !__DMC__ || GC_NO_INLINE_STD_NEW) && _MSVC_LANG>=201402] (delete(void*,size_t)): Define. * gc_cpp.cc [(!_MSC_VER && !__DMC__ || GC_NO_INLINE_STD_NEW) && _MSVC_LANG>=201402 && GC_OPERATOR_NEW_ARRAY && !CPPCHECK] (delete[](void*,size_t)): Likewise. * include/gc_cpp.h [!GC_NO_INLINE_STD_NEW && (_MSC_VER || __DMC__ || (__BORLANDC__ || __CYGWIN__ || __CYGWIN32__ || __MINGW32__ || __WATCOMC__) && !GC_BUILD && !GC_NOT_DLL) && _MSVC_LANG>=201402] (delete(void*,size_t)): Likewise. * include/gc_cpp.h [!GC_NO_INLINE_STD_NEW && (_MSC_VER || __DMC__ || (__BORLANDC__ || __CYGWIN__ || __CYGWIN32__ || __MINGW32__ || __WATCOMC__) && !GC_BUILD && !GC_NOT_DLL) && _MSVC_LANG>=201402 && GC_OPERATOR_NEW_ARRAY] (delete[](void*,size_t)): Likewise. * include/gc_allocator.h [!GC_ATTR_EXPLICIT && _MSVC_LANG>=201103] (GC_ATTR_EXPLICIT): Define to "explicit" instead of empty. * tests/test_cpp.cc [!GC_ATTR_EXPLICIT && _MSVC_LANG>=201103] (GC_ATTR_EXPLICIT): Likewise. * include/gc_allocator.h [!GC_NOEXCEPT && _MSC_VER && !(_HAS_EXCEPTIONS && !_HAS_EXCEPTIONS) && _MSVC_LANG>=201103] (GC_NOEXCEPT): Define to noexcept instead of throw(). * include/gc_cpp.h [!GC_NOEXCEPT && _MSC_VER && !(_HAS_EXCEPTIONS && !_HAS_EXCEPTIONS) && _MSVC_LANG>=201103] (GC_NOEXCEPT): Likewise.
* Move GC_throw_bad_alloc definition to new C++ fileIvan Maidanski2019-11-041-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #268 (bdgwc). * CMakeLists.txt [enable_cplusplus] (gccpp): Add gc_badalc.cc library source file. * Makefile.am [CPLUSPLUS] (libgccpp_la_SOURCES): Likewise. * Makefile.am (EXTRA_DIST): Add gc_badalc.cpp. * Makefile.direct (SRCS): Add gc_badalc.cc. * Makefile.direct (gc_badalc.o): New target. * NT_MAKEFILE (gc_badalc.obj): Likewise. * WCC_MAKEFILE (gc_badalc.obj): Likewise. * digimars.mak (gc_badalc.obj): Likewise. * build/s60v3/libgc.mmp (SOURCE): Mention gc_badalc.cpp (commented out). * Makefile.direct (c++): Add dependency on gc_badalc.o; pass gc_badalc.o to ru tool. * NT_MAKEFILE (gccpp.lib): Add dependency on gc_badalc.obj; pass gc_badalc.obj to lib or link tool. * WCC_MAKEFILE (gccpp.lib, gccpp.dll): Likewise. * digimars.mak (OBJS): Add gc_badalc.obj. * doc/README.Mac (Files to build the GC libraries): Add gc_badalc.cc. * doc/gcinterface.md (C++ Interface): Mention gc_badalc.cc file. * gc_badalc.cc: New file. * gc_badalc.cpp: Likewise. * gc_cpp.cc (GC_throw_bad_alloc): Move to gc_badalc.cc. * gc_cpp.cc (GC_ALLOCATOR_THROW_OR_ABORT): Add comment; do not define unless GC_NO_INLINE_STD_NEW, or not _MSC_VER and not __DMC__. * tests/tests.am [CPLUSPLUS && AVOID_CPP_LIB] (test_cpp_LDADD): Add gc_badalc.o.
* New macro to avoid system-wide new/delete inlining in gc_cpp.h (Win32)Ivan Maidanski2019-10-151-2/+28
| | | | | | | | | | | | | | | | (fix of commit 3d784ed) * doc/README.macros (GC_NO_INLINE_STD_NEW): Document. * gc_cpp.cc [(_MSC_VER || __DMC__) && GC_NO_INLINE_STD_NEW && GC_NEW_DELETE_NEED_THROW] (GC_DECL_NEW_THROW): Define. * gc_cpp.cc [(_MSC_VER || __DMC__) && GC_NO_INLINE_STD_NEW] (operator new, operator delete): Likewise. * include/gc_cpp.h [_MSC_VER || __DMC__ || (__BORLANDC__ || __CYGWIN__ || __MINGW32__ || __WATCOMC__) && !GC_BUILD && !GC_NOT_DLL] (operator new, operator delete): Do not define inline function if GC_NO_INLINE_STD_NEW. * gc_cpp.cc [GC_NO_INLINE_STD_NEW && _MSC_VER] (operator new, operator delete): Declare; move comment.
* Fix gc_cpp.h file name in comments after renamingIvan Maidanski2019-10-111-1/+1
| | | | | * gc_cpp.cc: Rename gc_c++.h to gc_cpp.h in the head comment. * tests/test_cpp.cc: Likewise.
* Fix 'ISO C++17 does not allow dynamic exception spec' clang-8 errorIvan R2019-06-221-1/+7
| | | | | | | | | | | | | | | Issue #287 (bdwgc). Before this patch, clang 8 (and -std=c++1z) fails for gc_cpp.cc. The error message produced is: ISO C++17 does not allow dynamic exception specifications. The "dynamic exception" syntax was declared deprecated in C++11 and removed in C++17. * gc_cpp.cc [!_MSC_VER && !__DMC__ && GC_NEW_DELETE_NEED_THROW && __cplusplus >= 201703L] (GC_DECL_NEW_THROW): Define to noexcept(false); add comment.
* Do not include windows.h when compiling gc_cpp.ccIvan Maidanski2018-06-201-0/+1
| | | | | | | | | | | | (code refactoring) * gc_cpp.cc (GC_DONT_INCL_WINDOWS_H): Define macro before include gc.h. * tests/test_cpp.cc (GC_DONT_INCL_WINDOWS_H): Likewise. * include/gc.h [GC_WIN32_THREADS && (!GC_PTHREADS || GC_BUILD || GC_WINDOWS_H_INCLUDED) && (!GC_NO_THREAD_DECLS || GC_BUILD)]: If GC_DONT_INCL_WINDOWS_H then do not include process.h, windows.h, and do not declare GC_CreateThread, GC_ExitThread, GC_DllMain, GC_beginthreadex, GC_endthreadex.
* Do not include 'new' standard header from gc_cpp.h by defaultIvan Maidanski2018-06-191-7/+23
| | | | | | | | | | | | | | | | | | | | | | (fix of commit cb1194d17) * gc_cpp.cc: Include gc.h (before "new") and "new" standard header (before gc_cpp.h). * gc_cpp.cc (GC_ALLOCATOR_THROW_OR_ABORT): New macro (the same definition as in gc_allocator.h). * gc_cpp.cc (GC_throw_bad_alloc): New API function definition. * gc_cpp.cc [!GC_NEW_DELETE_THROW_NOT_NEEDED] (GC_NEW_DELETE_NEED_THROW): Do not define if _MSC_VER or __DMC__. * gc_cpp.cc [!_MSC_VER && !__DMC__] (new, new[]): Replace GC_OP_NEW_OOM_CHECK(obj) to if(!obj)GC_ALLOCATOR_THROW_OR_ABORT(). * gc_cpp.h: Include "new" standard header only if GC_INCLUDE_NEW and !GC_NEW_ABORTS_ON_OOM and !_LIBCPP_NO_EXCEPTIONS. * gc_cpp.h [!GC_NEW_ABORTS_ON_OOM && !_LIBCPP_NO_EXCEPTIONS && !GC_INCLUDE_NEW] (GC_throw_bad_alloc): Declare API function. * gc_cpp.h [!GC_NEW_ABORTS_ON_OOM && !_LIBCPP_NO_EXCEPTIONS && !GC_INCLUDE_NEW] (GC_OP_NEW_OOM_CHECK): Call GC_throw_bad_alloc() instead of throw std::bad_alloc; do not use do-while(0) (to eliminate VC++ warning that the expression is always false).
* Do not specify throw(bad_alloc) in gc_cpp.hIvan Maidanski2018-06-151-0/+12
| | | | | | | | | | (fix of commit cb1194d17) * gc_cpp.cc (GC_NEW_DELETE_NEED_THROW, GC_DECL_NEW_THROW): Move from gc_cpp.h. * include/gc_cpp.h (gc::new, new): Remove GC_DECL_NEW_THROW specifier. * include/gc_cpp.h [GC_OPERATOR_NEW_ARRAY] (gc::new[], new[]): Likewise.
* Use noexcept specifier in gc_cpp if C++11Ivan Maidanski2018-06-081-4/+4
| | | | | | | | | | | | | | | | * gc_cpp.cc [!_MSC_VER && !__DMC__] (delete, delete[]): Rename GC_DECL_DELETE_THROW to GC_NOEXCEPT. * include/gc_cpp.h: Always include "new" header. * include/gc_cpp.h [!GC_NEW_DELETE_THROW_NOT_NEEDED] (GC_NEW_DELETE_NEED_THROW): Do not define if __BORLANDC__ or _MSC_VER, or __WATCOMC__, or if __cplusplus>=201103L and !__clang__. * include/gc_cpp.h (GC_DECL_DELETE_THROW): Remove. * include/gc_cpp.h [!GC_NOEXCEPT] (GC_NOEXCEPT): Define internal macro to except or throw(), or nothing (same as that in gc_allocator.h). * include/gc_cpp.h [!GC_NEW_ABORTS_ON_OOM] (GC_NEW_ABORTS_ON_OOM): Define if GC_NOEXCEPT is defined to nothing. * include/gc_cpp.h (new(size_t,void*), new[](size_t,void*), delete): Add GC_NOEXCEPT.
* Fix new and delete operators definition for DigitalMars compilerIvan Maidanski2018-06-041-1/+1
| | | | | | | | * gc_cpp.cc (new, delete, new[], delete[]): Do not define if __DMC__. * include/gc_cpp.h (new[], delete[], new, delete): Define also if __DMC__. * include/gc_cpp.h [_MSC_VER] (new[], delete[]): Replace _MSC_VER>1020 to defined(GC_OPERATOR_NEW_ARRAY).
* Never return null pointer by C++ operator new (gc_cpp)Ivan Maidanski2018-06-011-15/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now, in case of the allocation failure, new and new[] operators throw bad_alloc (or abort the application if an ancient compiler is used). * gc_cpp.cc (GC_NEW_DELETE_NEED_THROW): Remove. * gc_cpp.cc (GC_DECL_NEW_THROW, GC_DECL_DELETE_THROW): Move macro definition to gc_cpp.h. * gc_cpp.cc [GC_NEW_DELETE_NEED_THROW]: Do not include "new" header. * gc_cpp.cc [!_MSC_VER] (operator new): Call GC_OP_NEW_OOM_CHECK() for the allocation result. * gc_cpp.cc [!_MSC_VER && GC_OPERATOR_NEW_ARRAY && !CPPCHECK] (operator new[]): Likewise. * include/gc.h (GC_abort_on_oom): Declare new API function. * include/gc_cpp.h [!GC_NEW_DELETE_THROW_NOT_NEEDED && (GC_GNUC_PREREQ(4,2) || __BORLANDC__>=0x0550 || _MSC_VER>1020 || __WATCOMC__>=1050)] (GC_NEW_DELETE_NEED_THROW): Define macro. * include/gc_cpp.h [GC_NEW_DELETE_NEED_THROW]: Include "new" header. * include/gc_cpp.h (GC_OP_NEW_OOM_CHECK): New internal macro (throws bad_alloc or cals GC_abort_on_oom). * include/gc_cpp.h (gc::new(size_t), gc::new(size_t,GCPlacement), new): Add GC_DECL_NEW_THROW; call GC_OP_NEW_OOM_CHECK() for the allocation result. * include/gc_cpp.h [GC_OPERATOR_NEW_ARRAY] (gc::new[](size_t), gc::new[](size_t,GCPlacement, new[]): Likewise. * misc.c (GC_abort_on_oom): Implement function. * tests/test.c [CPPCHECK] (main): Call UNTESTED(GC_abort_on_oom).
* Fix global operator delete definition for C++14 in gc_cppIvan Maidanski2018-01-151-0/+14
| | | | | | | | | | | | | Issue #195 (bdwgc). Sized variants of global operator delete should be defined along with the non-sized ones. Otherwise compiler might invoke the one from the standard library (as observed in e.g. Cygwin) leading to a crash. * gc_cpp.cc [!_MSC_VER && __cplusplus>201103L] (operator delete): Define sized variant (the size argument is ignored for now). * gc_cpp.cc [!_MSC_VER && __cplusplus>201103L && GC_OPERATOR_NEW_ARRAY && !CPPCHECK] (operator delete[]): Likewise.
* Define CLANG/GNUC_PREREQ macros to check gcc/clang minimum versionIvan Maidanski2017-03-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (code refactoring) * cord/cordxtra.c (CORD_ATTR_UNUSED): Use GC_GNUC_PREREQ() instead of direct use of __GNUC[_MINOR]__. * gc_cpp.cc (GC_NEW_DELETE_NEED_THROW): Likewise. * include/gc_config_macros.h (GC_API, GC_ATTR_MALLOC, GC_ATTR_ALLOC_SIZE, GC_ATTR_NONNULL, GC_ATTR_DEPRECATED, GC_RETURN_ADDR, GC_RETURN_ADDR_PARENT, GC_PTHREAD_EXIT_ATTRIBUTE): Likewise. * include/gc_cpp.h (GC_NO_OPERATOR_NEW_ARRAY): Likewise. * include/gc_inline.h (GC_EXPECT, GC_PREFETCH_FOR_WRITE): Likewise. * include/new_gc_alloc.h: Likewise. * include/private/gc_priv.h (GC_INNER, GC_ATTR_UNUSED, EXPECT, GC_INLINE, GC_ATTR_NOINLINE, GC_API_OSCALL, GC_ATTR_FORMAT_PRINTF, NONNULL_ARG_NOT_NULL): Likewise. * include/private/gc_priv.h [CANCEL_SAFE] (GC_cancel_disable_count): Likewise. * include/private/gcconfig.h (HAVE_BUILTIN_UNWIND_INIT, PREFETCH, GC_PREFETCH_FOR_WRITE): Likewise. * include/private/gcconfig.h [I386 && LINUX && __ELF__] (GC_NO_SIGSETJMP): Likewise. * include/private/gcconfig.h [X86_64 && MSWIN32] (MPROTECT_VDB): Likewise. * include/private/thread_local_alloc.h [CYGWIN32] (USE_PTHREAD_SPECIFIC): Likewise. * include/private/thread_local_alloc.h [LINUX && !ARM32 && !AVR32 || PLATFORM_ANDROID && !__clang__] (USE_COMPILER_TLS): Likewise. * mark.c [MSWIN32 || MSWINCE] (GC_mark_some): Likewise. * mark_rts.c (GC_approx_sp): Likewise. * tests/test_cpp.cc (ATTR_UNUSED): Likewise. * tools/setjmp_t.c (nested_sp): Likewise. * include/gc_config_macros.h (GC_GNUC_PREREQ): New macro (not for public use). * include/private/gc_priv.h (GC_CLANG_PREREQ): New private macro. * include/private/gcconfig.h (HAVE_BUILTIN_UNWIND_INIT): Refine comment. * include/private/thread_local_alloc.h [LINUX && !ARM32 && !AVR32 || PLATFORM_ANDROID && !__clang__] (USE_COMPILER_TLS): Use GC_CLANG_PREREQ() instead of direct use of __clang_major__ and __clang_minor__. * mark.c [MSWIN32 || MSWINCE] (GC_mark_some): Likewise.
* Workaround 'operator delete[]/new[] never used' cppcheck false warningIvan Maidanski2016-11-171-1/+1
| | | | | * gc_cpp.cc [!_MSC_VER && GC_OPERATOR_NEW_ARRAY] (operator new[], operator delete[]): Do not define if CPPCHECK.
* Fix 'replacement operator delete cannot be inline' GCC warning (Cygwin)Ivan Maidanski2016-10-291-5/+3
| | | | | | | | | | | | | | (fix commits 83e0a2c, 3379238) This commit also eliminates "operator delete is missing exception specification throw()" compiler warning. * gc_cpp.cc (operator delete): Define unconditionally (i.e. for Cygwin too). * include/gc_cpp.h [__CYGWIN__]: Do not include "new" header. * include/gc_cpp.h [__CYGWIN__] (operator delete): Remove (as replacement function 'operator delete' cannot be declared 'inline').
* Reformat code of gc_cpp.cc/hIvan Maidanski2015-05-111-1/+1
| | | | | | | | | | * include/gc_cpp.h: Reformat code (and comments). * gc_cpp.cc: Likewise. * include/gc_cpp.h (operator new): Replace if-then-else with switch. Conflicts: include/gc_cpp.h
* Restore definition of new/delete operators in gc_cpp.cc (for non-VC)Ivan Maidanski2015-05-111-0/+24
| | | | | | | | | | | (revert part of commit 3d784ed) * gc_cpp.cc (new, delete, new[], delete[]): Add definition (unless _MSC_VER defined). Conflicts: gc_cpp.cc
* Remove commented out code in gc_cpp.cc/hIvan Maidanski2015-05-111-42/+0
| | | | | | | | | | | | (code refactoring) * gc_cpp.cc: Remove commented out code. * include/gc_cpp.h: Likewise. Conflicts: gc_cpp.cc include/gc_cpp.h
* put all the cpp stuff in headerJohannes Totz2015-05-111-43/+41
| | | | | | | | | otherwise vc9 will mix up new and delete operators (due to arbitrary ordering during linking) Conflicts: gc_cpp.cc include/gc_cpp.h
* Fix more typos in comments and documentationIvan Maidanski2013-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * alloc.c: Fix typo ("overflow"). * configure.ac: Fix typo ("optimization"). * doc/README.amiga: Fix typos ("also", "specific", "unnecessary"). * doc/README.cords: Fix typos ("descendants", "highlighted"). * ChangeLog: Fix typos ("[un]collectible"). * README.md: Likewise. * dbg_mlc.c: Likewise. * doc/README.hp: Likewise. * doc/README.linux: Likewise. * doc/gcdescr.html: Likewise. * doc/gcinterface.html: Likewise. * include/gc_mark.h: Likewise. * include/gc_pthread_redirects.h: Likewise. * include/new_gc_alloc.h: Likewise. * include/private/dbg_mlc.h: Likewise. * include/private/gc_pmark.h: Likewise. * include/private/gc_priv.h: Likewise. * new_hblk.c: Likewise. * ChangeLog: Fix typo ("multi-threaded"). * cord/cordxtra.c: Likewise. * doc/debugging.html: Likewise. * doc/gcinterface.html: Likewise. * doc/leak.html: Likewise. * doc/overview.html: Likewise. * doc/simple_example.html: Likewise. * include/gc_mark.h: Likewise. * include/private/gc_priv.h: Likewise. * os_dep.c: Likewise. * ptr_chck.c: Likewise. * README.md: Fix typo ("pointer-free"). * allchblk.c: Likewise. * doc/debugging.html: Likewise. * doc/gcdescr.html: Likewise.
* Eliminate 'missing exception specification' warning in gc_cpp.cc (Clang)Ivan Maidanski2012-08-301-6/+20
| | | | | | | | | | | | * gc_cpp.cc (GC_NEW_DELETE_NEED_THROW): Define new macro (if not defined yet) for GCC v4.2+ (or clang). * gc_cpp.cc: Include new (for std::bad_alloc) if GC_NEW_DELETE_NEED_THROW. * gc_cpp.cc (GC_DECL_NEW_THROW, GC_DECL_DELETE_THROW): New macros (used to eliminate compiler "missing exception specification" warning for 'new' and 'delete' operators). * gc_cpp.cc (new, delete, new[], delete[]): Use GC_DECL_NEW/DELETE_THROW to define 'throw' clause properly.
* Include "config.h" instead of "private/config.h" on HAVE_CONFIG_HIvan Maidanski2012-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | (Change the behavior of HAVE_CONFIG_H macro to the standard one which assumes that no folder is specified in #include "config.h".) * configure.ac (AM_CONFIG_HEADER): Replace include/private/config.h to include/config.h. * cord/cordbscs.c: Include "config.h" (instead of "private/config.h") if HAVE_CONFIG_H defined. * cord/cordprnt.c: Likewise. * cord/cordxtra.c: Likewise. * gc_cpp.cc: Likewise. * include/private/gc_pmark.h: Likewise. * include/private/gc_priv.h: Likewise. * real_malloc.c: Likewise. * tests/disclaim_test.c: Likewise. * tests/initsecondarythread.c: Likewise. * tests/subthread_create.c: Likewise. * tests/test.c: Likewise. * tests/test_cpp.cc: Likewise. * tests/thread_leak_test.c: Likewise. * tests/threadkey_test.c: Likewise.
* Reformat code of gc_cpp.cc/hIvan Maidanski2011-12-261-33/+33
| | | | | | * gc_cpp.cc (new, new[], delete[]): Reformat code. * include/gc_cpp.h (GCPlacement, gc, gc_cleanup, new, new[], delete, cleanup): Likewise.
* HOTFIX: Fix gc_cpp.cc for Cygwin (remove duplicate function definition).Ivan Maidanski2011-09-131-2/+5
| | | | | * gc_cpp.cc (operator delete): Do not define for Cygwin since already defined in include/gc_cpp.h file.
* Remove information about the authors from the source files.Ivan Maidanski2011-08-251-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (This information could be observed via "git log" or by looking into the original version of a file.) * Makefile.am: Remove original-author and modified-by information (as well as a time-stamp) from the file header. * configure.ac: Ditto. * cord/cordbscs.c: Ditto. * cord/cordprnt.c: Ditto. * cord/cordxtra.c: Ditto. * cord/de.c: Ditto. * cord/de_cmds.h: Ditto. * cord/de_win.h: Ditto. * doc/README.arm.cross: Ditto. * doc/doc.am: Ditto. * dyn_load.c: Ditto. * gc_cpp.cc: Ditto. * gc_dlopen.c: Ditto. * include/cord.h: Ditto. * include/include.am: Ditto. * include/private/cord_pos.h: Ditto. * include/private/gc_hdrs.h: Ditto. * include/weakpointer.h: Ditto. * m4/gc_set_version.m4: Ditto. * tests/test_cpp.cc: Ditto. * cord/cordprnt.c: Fix a typo in a comment. * AUTHORS: Add authors. * cord/cordprnt.c: Expand all tabs to spaces; remove trailing spaces at EOLn. * cord/de.c: Ditto. * cord/de_cmds.h: Ditto. * cord/de_win.c: Ditto. * cord/de_win.h: Ditto. * doc/README.arm.cross: Ditto. * include/private/cord_pos.h: Ditto. * include/weakpointer.h: Ditto. * m4/gc_set_version.m4: Ditto.
* 2009-10-19 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-1/+1
| | | | * gc_cpp.cc: Include "gc_cpp.h" instead of <gc_cpp.h>.
* 2009-09-16 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ChangeLog: Remove trailing spaces at EOLn; insert blank lines where missed. * doc/README: Expand all tabs to spaces; remove trailing spaces at EOLn; remove multiple trailing blank lines. * doc/README.autoconf: Ditto. * doc/README.DGUX386: Ditto. * doc/README.environment: Ditto. * doc/README.macros: Ditto. * doc/README.win32: Ditto. * tests/test.c: Ditto. * tests/test_cpp.cc: Ditto. * backgraph.c: Ditto. * blacklst.c: Ditto. * checksums.c: Ditto. * darwin_stop_world.c: Ditto. * dbg_mlc.c: Ditto. * dyn_load.c: Ditto. * finalize.c: Ditto. * gc_dlopen.c: Ditto. * gcj_mlc.c: Ditto. * headers.c: Ditto. * mach_dep.c: Ditto. * malloc.c: Ditto. * mallocx.c: Ditto. * new_hblk.c: Ditto. * obj_map.c: Ditto. * ptr_chck.c: Ditto. * real_malloc.c: Ditto. * reclaim.c: Ditto. * stubborn.c: Ditto. * thread_local_alloc.c: Ditto. * typd_mlc.c: Ditto. * gc_cpp.cc: Ditto. * include/gc_allocator.h: Ditto. * include/gc_backptr.h: Ditto. * include/gc_config_macros.h: Ditto. * include/gc_cpp.h: Ditto. * include/gc_gcj.h: Ditto. * include/gc_inline.h: Ditto. * include/gc_mark.h: Ditto. * include/gc_pthread_redirects.h: Ditto. * include/gc_typed.h: Ditto. * include/gc_version.h: Ditto. * include/javaxfc.h: Ditto. * include/new_gc_alloc.h: Ditto. * include/private/darwin_semaphore.h: Ditto. * include/private/dbg_mlc.h: Ditto. * include/private/gc_hdrs.h: Ditto. * include/private/gc_locks.h: Ditto. * include/private/gc_pmark.h: Ditto. * include/private/gcconfig.h: Ditto. * include/private/pthread_support.h: Ditto. * include/private/thread_local_alloc.h: Ditto. * darwin_stop_world.c: Add copyright header. * include/gc_backptr.h: Ditto. * include/gc_config_macros.h: Ditto. * include/gc_pthread_redirects.h: Ditto. * include/gc_version.h: Ditto. * include/javaxfc.h: Ditto. * include/private/darwin_semaphore.h: Ditto. * include/private/pthread_support.h: Ditto. * gc_cpp.cc: Make copyright header uniform across the package. * include/gc_cpp.h: Ditto.
* 2009-09-16 Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)ivmai2011-07-261-1/+1
| | | | | | | | | | | | (gc_config_h_6a.patch with a minor correction) * include/private/gc_priv.h: Change include of config.h to private/config.h. * include/private/gc_pmark.h: Ditto. * gc_cpp.cc: Ditto. * tests/test.c: Ditto. * tests/test_cpp.cc: Include private/config.h (if HAVE_CONFIG_H); undefine GC_BUILD.
* 2009-09-10 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (diff116a, diff116b, diff116c) * Makefile.direct (GC_DLL): Add the comment for. * doc/README.macros: Fix a typo. * doc/README.macros (_DLL, GC_DLL, GC_NOT_DLL): Update info. * doc/README.macros (__STDC__): Remove info. * dbg_mlc.c (GC_get_back_ptr_info, GC_generate_random_heap_address, GC_generate_random_valid_address, GC_print_backtrace, GC_generate_random_backtrace, GC_register_describe_type_fn): Add GC_API and GC_CALL to function definition. * malloc.c (GC_generic_malloc): Ditto. * mallocx.c (GC_incr_bytes_allocd, GC_incr_bytes_freed): Ditto. * mark.c (GC_mark_and_push): Ditto. * misc.c (GC_new_free_list_inner, GC_new_free_list, GC_new_kind_inner, GC_new_kind, GC_new_proc_inner, GC_new_proc): Ditto. * include/gc_backptr.h (GC_get_back_ptr_info, GC_generate_random_heap_address, GC_generate_random_valid_address, GC_generate_random_backtrace, GC_print_backtrace): Add GC_API and GC_CALL to function prototype. * include/gc_mark.h (GC_mark_and_push, GC_new_free_list, GC_new_free_list_inner, GC_new_kind, GC_new_kind_inner, GC_new_proc, GC_new_proc_inner, GC_generic_malloc, GC_register_describe_type_fn): Ditto. * include/new_gc_alloc.h (GC_incr_bytes_allocd, GC_incr_mem_freed, GC_generic_malloc_words_small): Ditto. * gc_cpp.cc: Include "config.h" (if HAVE_CONFIG_H defined). * include/private/gc_pmark.h: Ditto. * include/private/gc_priv.h: Ditto. * tests/test.c: Ditto. * gc_cpp.cc: Define GC_BUILD. * include/private/gc_pmark.h: Ditto. * include/private/gc_priv.h: Ditto. * gc_dlopen.c (WRAP_FUNC, REAL_FUNC): New macro. * gc_dlopen.c (dlopen): Add GC_API to the wrapper function definition. * pthread_support.c (GC_pthread_create, GC_pthread_sigmask, GC_pthread_join, GC_pthread_detach, pthread_sigmask, pthread_join, pthread_detach, pthread_create): Ditto. * win32_threads.c (GC_pthread_join, GC_pthread_create, GC_pthread_sigmask, GC_pthread_detach): Ditto. * gc_dlopen.c (dlopen): Use WRAP_FUNC and REAL_FUNC macros. * include/gc_backptr.h: Include "gc.h". * include/gc_backptr.h: Use extern "C" for the exported functions. * include/gc_mark.h: Ditto. * include/gc_config_macros.h (GC_THREADS): Define the macro if any GC_XXX_THREADS is defined. * include/gc_config_macros.h (_PTHREADS, _POSIX4A_DRAFT10_SOURCE): Move the definitions below the place where GC_NETBSD_THREADS and GC_DGUX386_THREADS are defined. * include/gc_config_macros.h (GC_DLL): Don't define (even if _DLL is defined) for GCC. * include/gc_config_macros.h (GC_API): Define for Cygwin (in the same way as for VC++); define for GCC v4+ (other than already recognized MinGW/Cygwin) as a "default" visibility attribute if GC_DLL is defined. * include/gc_config_macros.h (GC_ATTR_MALLOC, GC_ATTR_ALLOC_SIZE): New macro. * include/gc.h (GC_malloc, GC_malloc_atomic, GC_strdup, GC_malloc_uncollectable, GC_malloc_stubborn, GC_memalign, GC_malloc_atomic_uncollectable, GC_malloc_ignore_off_page, GC_malloc_atomic_ignore_off_page, GC_debug_malloc, GC_debug_malloc_atomic, GC_debug_strdup, GC_debug_malloc_uncollectable, GC_debug_malloc_stubborn, GC_debug_malloc_ignore_off_page, GC_debug_malloc_atomic_ignore_off_page, GC_debug_malloc_replacement): Add GC_ATTR_MALLOC attribute. * include/gc_gcj.h (GC_gcj_malloc, GC_debug_gcj_malloc, GC_gcj_malloc_ignore_off_page): Ditto. * include/gc.h (GC_malloc, GC_malloc_atomic, GC_malloc_uncollectable, GC_malloc_stubborn, GC_malloc_atomic_uncollectable, GC_malloc_ignore_off_page, GC_malloc_atomic_ignore_off_page, GC_debug_malloc, GC_debug_malloc_atomic, GC_debug_malloc_uncollectable, GC_debug_malloc_stubborn, GC_debug_malloc_ignore_off_page, GC_debug_malloc_atomic_ignore_off_page, GC_debug_malloc_replacement: Add GC_ATTR_ALLOC_SIZE attribute (for the first argument). * include/gc_gcj.h (GC_gcj_malloc, GC_debug_gcj_malloc, GC_gcj_malloc_ignore_off_page): Ditto. * include/gc.h (GC_memalign, GC_realloc, GC_debug_realloc, GC_debug_realloc_replacement): Add GC_ATTR_ALLOC_SIZE attribute (for the second argument). * include/gc.h (GC_malloc, GC_malloc_atomic, GC_strdup, GC_malloc_uncollectable, GC_malloc_stubborn, GC_memalign, GC_malloc_atomic_uncollectable, GC_free, GC_base, GC_size, GC_realloc, GC_expand_hp, GC_set_max_heap_size, GC_exclude_static_roots, GC_add_roots, GC_remove_roots, GC_register_displacement, GC_debug_register_displacement, GC_try_to_collect, GC_malloc_ignore_off_page, GC_malloc_atomic_ignore_off_page, GC_debug_malloc, GC_debug_malloc_atomic, GC_debug_strdup, GC_debug_malloc_uncollectable, GC_debug_malloc_stubborn, GC_debug_malloc_ignore_off_page, GC_debug_malloc_atomic_ignore_off_page, GC_debug_free, GC_debug_realloc, GC_debug_malloc_replacement, GC_debug_realloc_replacement, GC_finalization_proc, GC_register_finalizer, GC_debug_register_finalizer, GC_register_finalizer_ignore_self, GC_debug_register_finalizer_ignore_self, GC_register_finalizer_no_order, GC_debug_register_finalizer_no_order, GC_register_finalizer_unreachable, GC_debug_register_finalizer_unreachable, GC_register_disappearing_link, GC_general_register_disappearing_link, GC_unregister_disappearing_link, GC_noop1, GC_warn_proc, GC_set_warn_proc, GC_ignore_warn_proc, GC_fn_type, GC_call_with_alloc_lock, GC_stack_base_func, GC_call_with_stack_base, GC_same_obj, GC_pre_incr, GC_post_incr, GC_is_visible, GC_is_valid_displacement, GC_same_obj_print_proc, GC_is_valid_displacement_print_proc, GC_is_visible_print_proc, GC_malloc_many, GC_CreateThread, GC_beginthreadex, GC_endthreadex): Comment out (or remove if single and meaningless) function argument names (to avoid identifiers out of the name space). * include/gc_gcj.h (GC_init_gcj_malloc, GC_gcj_malloc, GC_debug_gcj_malloc, GC_gcj_malloc_ignore_off_page): Ditto. * include/gc.h (GC_try_to_collect): Update the comment. * include/gc.h (GC_size, GC_register_my_thread): Add const qualifier for the argument referent. * misc.c (GC_size): Ditto. * pthread_support.c (GC_register_my_thread_inner, GC_register_my_thread): Ditto. * win32_threads.c (GC_register_my_thread_inner, GC_register_my_thread): Ditto. * include/gc.h (GC_INIT_CONF_ROOTS): New macro for internal use (define instead of GC_INIT() for Cygwin and AIX). * include/gc.h (GC_DONT_EXPAND, GC_MAX_RETRIES, GC_FREE_SPACE_DIVISOR, GC_FULL_FREQ, GC_TIME_LIMIT, GC_IGNORE_WARN, GC_INITIAL_HEAP_SIZE): Recognize new macro. * include/gc.h (GC_INIT_CONF_DONT_EXPAND, GC_INIT_CONF_MAX_RETRIES, GC_INIT_CONF_FREE_SPACE_DIVISOR, GC_INIT_CONF_FULL_FREQ, GC_INIT_CONF_TIME_LIMIT, GC_INIT_CONF_IGNORE_WARN, GC_INIT_CONF_INITIAL_HEAP_SIZE): New macro for internal use. * include/gc.h (GC_INIT): Use GC_INIT_CONF_XXX macros. * include/gc_mark.h: Prefix GC_H with '_'. * include/gc_mark.h (GC_least_plausible_heap_addr, GC_greatest_plausible_heap_addr, GC_debug_header_size): Use GC_API for the public variable declaration. * include/new_gc_alloc.h (GC_objfreelist_ptr, GC_aobjfreelist_ptr, GC_uobjfreelist_ptr, GC_auobjfreelist_ptr): Ditto. * include/gc_pthread_redirects.h (GC_pthread_create, GC_pthread_sigmask, GC_dlopen, GC_pthread_join, GC_pthread_detach): Use GC_API for the wrapper prototype. * include/gc_pthread_redirects.h (pthread_create, pthread_join, pthread_detach, pthread_sigmask, dlopen): Undefine unconditionally before redirecting. * include/new_gc_alloc.h: Replace GC_incr_mem_freed() with GC_incr_bytes_freed(); remove FIXME. * include/private/gc_priv.h (GC_make_closure, GC_debug_invoke_finalizer, GC_noop): Remove GC_API for the private function. * tests/test.c (GC_print_stats): Handle GC_DLL case regardless of the target.
* 2008-07-25 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)hboehm2011-07-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ivan's description of the patch follows. Note that a few pieces like the GC_malloc(0) patch, were not applied since an alternate had been previously applied. A few differed stylistically from the rest of the code (mostly casts to void * instead of target type), or were classified as too minor to bother. Note that all of Ivan's static declarations which did not correct outright naming bugs (as a few did), where replaced by STATIC, which is ignored by default. - minor bug fixing (for FreeBSD, for THREAD_LOCAL_ALLOC and for GC_malloc(0)); - addition of missing getter/setter functions for public variables (may be useful if compiled as Win32 DLL); - addition of missing GC_API for some exported functions; - addition of missing "static" declarator for internal functions and variables (where possible); - replacement of all remaining K&R-style definitions with ANSI C ones (__STDC__ macro is not used anymore); - addition of some Win32 macro definitions (that may be missing in the standard headers supplied with a compiler) for GWW_VDB mode; - elimination of most compiler warnings (except for "uninitialized data" warning); - several typos correction; - missing parenthesis addition in macros in some header files of "libatomic_ops" module. My highlights based on reading the patch: * allchblk.c: Remove GC_freehblk_ptr decl. Make free_list_index_of() static. * include/gc.h: Use __int64 on win64, define GC_oom_func, GC_finalizer_notifier_proc, GC_finalizer_notifier_proc, add getter and setters: GC_get_gc_no, GC_get_parallel, GC_set_oom_fn, GC_set_finalize_on_demand, GC_set_java_finalization, GC_set_dont_expand, GC_set_no_dls, GC_set_max_retries, GC_set_dont_precollect, GC_set_finalizer_notifier. Always define GC_win32_free_heap. gc_config_macros.h: Define _REENTRANT after processing GC_THREADS. * include/gc_cpp.h: Improve GC_PLACEMENT_DELETE test, handling of operator new[] for old Windows compilers. * include/gc_inline.h (GC_MALLOC_FAST_GRANS): Add parentheses around arguments. * dbg_mlc.c, malloc.c, misc.c: Add many GC_API specs. * mark.c (GC_mark_and_push_stack): Fix source argument for blacklist printing. * misc.c: Fix log file naming based on environment variable for Windows. Make GC_set_warn_proc and GC_set_free_space_divisor just return current value with 0 argument. Add DONT_USER_USER32_DLL. Add various getters and setters as in gc.h. * os_dep.c: Remove no longer used GC_disable/enable_signals implementations. (GC_get_stack_base): Add pthread_attr_destroy call. No longer set GC_old_bus_handler in DARWIN workaround. * pthread_support.c: GC_register_my_thread must also call GC_init_thread_local.
* 2007-12-18 Hans Boehm <Hans.Boehm@hp.com>hboehm2011-07-261-2/+1
| | | | | | | | | * gc_cpp.cc: Don't include gc_cpp.h from local directory. 2007-12-18 Hans Boehm <Hans.Boehm@hp.com> (really Adam Megacz) * allchblk.c, configure.ac (add --enable-munmap) * configure: Regenerate.
* 2006-04-12 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Andrei Polushin.)hboehm2011-07-261-0/+6
| | | | | | | | | | | | | | | * Makefile, Makefile.am, Makefile.direct, NT_MAKEFILE, NT_STATIC_THREADS_MAKEFILE, NT_THREADS_MAKEFILE, gc.mak, msvc_dbg.c, include/private/msvc_dbg.h: Add msvc_dbg.c, include/private/msvc_dbg.h. * Makefile.am, configure.ac: Simplify solaris threads handling. * gc_cpp.cc: Add another msft-specific new operator. * misc.c: Use per executable log-file location. * os_dep.c: Improve GetWriteWatch handling (incomplete). Support stack traces for MSVC++. * configure, Makefile.in: Regenerate. * include/gc_allocator.h: Add <new> include, more PTRFREE decls, MSVC++ 6 support.
* gc6.1 tarball importgc6_1Ivan Maidanski2011-07-261-2/+2
|
* gc6.1alpha4 tarball importgc6_1alpha4Ivan Maidanski2011-07-261-3/+15
|
* gc6.0 tarball importgc6_0Ivan Maidanski2011-07-261-15/+4
|
* gc4.13 tarball importgc4_13Ivan Maidanski2011-07-261-0/+14
|
* gc4.8 tarball importgc4_8Ivan Maidanski2011-07-261-0/+46