dded long weakref support.

* include/gc.h: Added 3 GC_API functions for long weakref support:
GC_register_long_link, GC_unregister_long_link and GC_move_long_link.
* include/gc.h: Added corresponding GC_REGISTER_LONG_LINK macros.
* finalize.c: Add implementation of the above functions,
GC_ll_hashtbl for long links and GC_old_ll_entries.
* finalize.c (GC_push_finalizer_structures): GC_push_all long link
hash table entries as well.
* finalize.c (GC_dump_finalization): Refactored dump
disappearing link code out to GC_dump_finalization_links accepting
an argument of pointer to struct dl_hashtbl_s.
* finalize.c (GC_print_finalization_stats): Added long link stats
print out.
* finalize.c (GC_finalize): Added saving current GC_ll_hashtbl
entry count to GC_old_ll_entries,
GC_make_disappearing_links_disappear and
GC_remove_dangling_disappearing_links for long links.
Added long weakref support.

* include/gc.h: Added 3 GC_API functions for long weakref support:
GC_register_long_link, GC_unregister_long_link and GC_move_long_link.
* include/gc.h: Added corresponding GC_REGISTER_LONG_LINK macros.
* finalize.c: Add implementation of the above functions,
GC_ll_hashtbl for long links and GC_old_ll_entries.
* finalize.c (GC_push_finalizer_structures): GC_push_all long link
hash table entries as well.
* finalize.c (GC_dump_finalization): Refactored dump
disappearing link code out to GC_dump_finalization_links accepting
an argument of pointer to struct dl_hashtbl_s.
* finalize.c (GC_print_finalization_stats): Added long link stats
print out.
* finalize.c (GC_finalize): Added saving current GC_ll_hashtbl
entry count to GC_old_ll_entries,
GC_make_disappearing_links_disappear and
GC_remove_dangling_disappearing_links for long links.
Merge branch 'add-long-weakref' of https://github.com/zachsaw/bdwgc into add-long-weakref
Redone the comments for long link GC_API functions.

* include/gc.h: As above.
Added GC_LONG_REFS_NOT_NEEDED ifdefs to exclude long link
functionality and other minor changes.

* finalize.c (GC_push_finalizer_structures,
GC_register_long_link, GC_unregister_long_link,
GC_move_long_link, GC_finalize): GC_LONG_REFS_NOT_NEEDED ifdefs to
exclude long link functionality.
* finalize.c (GC_dump_finalization_links,
GC_register_disappearing_link_inner,
GC_move_disappearing_link_inner): Changed from GC_INLINE to STATIC
function declaration.
* include/gc.h: use 2 spaces as a sentence delimiter in comment
added in previous commit.
Minor code refactoring of GC fork handlers (remove GC prefix)

* pthread_support.c (GC_fork_prepare_proc, GC_fork_parent_proc,
GC_fork_child_proc): Declare as "static" instead of STATIC; remove
"GC_" prefix.
* win32_threads.c (GC_fork_prepare_proc, GC_fork_parent_proc,
GC_fork_child_proc): Likewise.
* pthread_support.c (GC_fork_parent_proc): Refine comment.
* pthread_support.c (GC_thr_init): Remove "GC_" prefix for
fork_prepare/parent/child_proc (only if CAN_HANDLE_FORK).
* win32_threads.c (GC_thr_init): Likewise.
Improve fork test logging in gctest

* tests/test.c (run_one_test): Move fork testing block upper (so that
other tests run in parallel in parent process).
* tests/test.c (run_one_test): Log "fork performed" and
"child started" events (only if not NO_TEST_HANDLE_FORK).
Add manual POSIX fork handling support (Android)

* include/gc.h (GC_set_handle_fork): Update comment.
* include/gc.h (GC_atfork_prepare, GC_atfork_parent, GC_atfork_child):
New API proto.
* include/private/gc_priv.h (GC_handle_fork): Change type from GC_bool
to int (to hold a value of -1).
* misc.c (GC_handle_fork): Likewise.
* include/private/gc_priv.h (GC_handle_fork): Add comment.
* misc.c (GC_set_handle_fork): Likewise.
* include/private/gcconfig.h (CAN_HANDLE_FORK): Define also for HURD
and PLATFORM_ANDROID; do not define if HAVE_NO_FORK already defined.
* include/private/gcconfig.h (CAN_CALL_ATFORK): New macro (defined if
CAN_HANDLE_FORK but not HURD or PLATFORM_ANDROID).
* include/private/gcconfig.h (HAVE_NO_FORK): New macro (defined for
Win32, OS/2 and others).
* misc.c (GC_atfork_prepare, GC_atfork_parent, GC_atfork_child): New
API function definition (only if not CAN_HANDLE_FORK and not
HAVE_NO_FORK).
* misc.c (GC_handle_fork): Map all negative values of argument except
for -1 to a positive one stored to GC_handle_fork; call GC_init to
initialize GC_stderr before ABORT invocation (only if not
SMALL_CONFIG).
* pthread_support.c (GC_atfork_prepare, GC_atfork_parent,
GC_atfork_child): New API function definition (only if
CAN_HANDLE_FORK).
* win32_threads.c (GC_atfork_prepare, GC_atfork_parent,
GC_atfork_child): Likewise.
* pthread_support.c (GC_thr_init): No pthread_atfork call if not
CAN_CALL_ATFORK; adjust GC_handle_fork value if pthread_atfork
succeeds; do not about in case of pthread_atfork failure provided
GC_handle_fork is -1 (only if CAN_HANDLE_FORK).
* win32_threads.c (GC_thr_init): Likewise.
* tests/test.c (TEST_FORK_WITHOUT_ATFORK): Recognize new macro (do not
define NO_TEST_HANDLE_FORK in this case and set INIT_FORK_SUPPORT to
no-op).
* tests/test.c (INIT_FORK_SUPPORT): Define to GC_set_handle_fork(-1)
unless HANDLE_FORK, or NO_TEST_HANDLE_FORK or TEST_FORK_WITHOUT_ATFORK.
* tests/test.c (run_one_test): Surround fork() invocation with
GC_atfork_prepare, GC_atfork_parent, GC_atfork_child calls.
* win32_threads.c: Include unistd.h if CAN_CALL_ATFORK defined
(instead of CAN_HANDLE_FORK) to get pthread_atfork prototype.
Prevent POSIX fork if mprotect_thread is started (Darwin)

* pthread_support.c (GC_atfork_prepare): Abort if GC_dirty_maintained
is set for Darwin (only if MPROTECT_VDB) since graceful suspend/resume
of mprotect_thread is unsupported at present.
Minor code refactoring of dumping routines related to 'long' links

* finalize.c (struct disappearing_link): Remove STATIC.
* finalize.c (GC_dl_hashtbl, GC_ll_hashtbl): Define separately from
dl_hashtbl_s definition.
* finalize.c (GC_grow_table): Reformat comment.
* finalize.c (GC_dump_finalization_links): Pass 'dl_hashtbl' argument
as pointer to constant struct.
* finalize.c (GC_dump_finalization_links, GC_dump_finalization):
Adjust printed message.
* finalize.c (GC_old_ll_entries): Do not define if
GC_LONG_REFS_NOT_NEEDED.
* finalize.c (IF_LONG_REFS_PRESENT_ELSE): New macro (only if not
SMALL_CONFIG).
* finalize.c (GC_print_finalization_stats): Use
IF_LONG_REFS_PRESENT_ELSE (instead of testing GC_LONG_REFS_NOT_NEEDED);
make printed messages more compact.
Fix GC_CreateThread 'dwStackSize' argument type for Win64

* include/gc.h (GC_uintptr_t): Define (for Win32/CE) even if
GC_NO_THREAD_DECLS; move definition upper than GC_CreateThread.
* include/gc.h (GC_WIN32_SIZE_T): New macro (defined as GC_uintptr_t,
Win32 threads only).
* include/gc.h (GC_CreateThread): Use GC_WIN32_SIZE_T instead of DWORD
type for "dwStackSize" argument (Win32 threads only).
* win32_threads.c (GC_CreateThread): Likewise.
* tests/test.c (fork_a_thread): Verify types of GC_CreateThread
arguments by explicit casts (only if GC_WIN32_THREADS).
Fix ABORT definition for mingw32ce (WinCE)

* include/private/gc_priv.h (ABORT): Define as block statement
(instead of expression) for Win32/WinCE (unless NO_DEBUGGING) because
DebugBreak is defined as a statement in some toolchains (e.g.,
mingw32ce).
Allow pthread_kill error code logging in GC_suspend/resume (debugging)

* pthread_stop_world.c (GC_suspend_all, GC_start_world): Log
pthread_kill error code on failure if DEBUG_THREADS.
Fix GC_remove_all_threads_but_me for Android (fork support)

* pthread_support.c (GC_remove_all_threads_but_me): Update kernel_id
of "me" (if PLATFORM_ANDROID).
Fix GC_malloc_explicitly_typed_ignore_off_page for large allocations

* typd_mlc.c (GC_malloc_explicitly_typed_ignore_off_page): Use
BYTES_TO_GRANULES instead of BYTES_TO_WORDS when calculating "lg"
local variable value.
Update AUTHORS file
Make GC_generic_malloc_ignore_off_page() public

* include/gc_mark.h (GC_generic_malloc): Refine comment.
* include/gc_mark.h (GC_generic_malloc_ignore_off_page): Move
prototype from gc_priv.h and make it public; add GC_ATTR_MALLOC
attribute.
* include/private/gc_priv.h (GC_generic_malloc): Move comment to
gc_mark.h.
* include/private/gc_priv.h (GC_generic_malloc_ignore_off_page):
Remove GC-inner prototype.
* include/private/gc_priv.h (GC_generic_malloc_inner): Update comment.
* mallocx.c (GC_generic_malloc_ignore_off_page): Likewise.
* mallocx.c (GC_generic_malloc_ignore_off_page): Make public.
Update TODO (add FIXME regarding Win32 threads)
Add tests for GC_register/move/unregister_long_link

* tests/test.c (live_long_refs): New global variable (only if
not GC_LONG_REFS_NOT_NEEDED and not MACOS).
* tests/test.c (mktree): Test GC_REGISTER_LONG_LINK,
GC_move_long_link, GC_unregister_long_link (using live_long_refs)
unless GC_LONG_REFS_NOT_NEEDED.
* tests/test.c (check_heap_stats): Define "still_long_live" local
variable, count non-null elements of live_long_refs, print number of
non-null elements of live_long_refs (if any) unless
GC_LONG_REFS_NOT_NEEDED.
Merge branch 'master' into add-long-weakref

Conflicts:
	finalize.c