[m-rev.] diff: update GC version to 6.0alpha6
Fergus Henderson
fjh at cs.mu.OZ.AU
Tue Apr 10 14:51:06 AEST 2001
Estimated hours taken: 3
Branches: main
boehm_gc/*:
Merge in the changes from gc5.2 to gc6.0alpha6.
I won't post the diff for this, since it is very large and probably not
very useful. For a summary of the changes, see boehm_gc/doc/README.changes.
Note that many of the files in the boehm_gc directory have been moved into
subdirectories (include, doc, and test).
Instead, in case anyone does want to review what I've done in this merge,
here's a diff which shows all the changes that we have made to the Boehm
collector, after the gc6.0alpha6 merge.
$ cvs diff -rgc6.0alpha6
cvs diff: Diffing .
cvs diff: tag gc is not in file .cvsignore
cvs diff: tag gc is not in file .nocopyright
Index: Makefile
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/Makefile,v
retrieving revision 1.1.1.12
diff -u -d -u -r1.1.1.12 Makefile
--- Makefile 2001/04/10 01:00:57 1.1.1.12
+++ Makefile 2001/04/10 03:26:51
@@ -1,3 +1,26 @@
+#-----------------------------------------------------------------------------#
+# WARNING: This makefile is not safe for parallel makes.
+# This makefile should only be invoked with `-j1'.
+#
+# (The reason parallel makes break is because of the use of constructs like
+# `./if_not_there on_sparc_sunos5_so $(MAKE) dyn_load.o)' to handle
+# OS-specific dependencies; this can lead to one process noticing
+# a partially build dyn_load.o and trying to use it before it is
+# completely built.)
+#-----------------------------------------------------------------------------#
+# I have modified this file.
+# I've added a different rule for the libgc.a target,
+# added the `include ../Mmake.common' line,
+# and changed the rule for libgc.so to use the $(LINK_SHARED_LIB) macro
+# defined in ../Mmake.common.
+# I've change the definitions of CC, AS, and CFLAGS.
+# I've also modified the stuff to support for DLLs on gnu-win32
+# - fjh.
+#-----------------------------------------------------------------------------#
+
+MERCURY_DIR=..
+include ../Mmake.common
+
# Primary targets:
# gc.a - builds basic library
# c++ - adds C++ interface to library
@@ -6,25 +29,43 @@
# and runs some tests of collector and cords. Does not add cords or
# c++ interface to gc.a
# cord/de - builds dumb editor based on cords.
+
ABI_FLAG=
-CC=cc $(ABI_FLAG)
+# CC=cc $(ABI_FLAG)
+
+# Mercury-specific definition of CC:
+CC=../scripts/mgnuc --grade $(GRADE) --no-ansi --no-check
+
CXX=g++ $(ABI_FLAG)
-AS=as $(ABI_FLAG)
+# Needed only for "make c++", which adds the c++ interface
+
+# AS=as $(ABI_FLAG)
# The above doesn't work with gas, which doesn't run cpp.
# Define AS as `gcc -c -x assembler-with-cpp' instead.
# Under Irix 6, you will have to specify the ABI (-o32, -n32, or -64)
# if you use something other than the default ABI on your machine.
+# Mercury-specific AS:
+AS=../scripts/mgnuc --grade $(GRADE) --assemble
# Redefining srcdir allows object code for the nonPCR version of the collector
# to be generated in different directories.
srcdir= .
VPATH= $(srcdir)
-CFLAGS= -O -I$(srcdir)/include -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DNO_EXECUTE_PERMISSION -DSILENT -DALL_INTERIOR_POINTERS
+# CFLAGS= -O -I$(srcdir)/include -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS \
+# -DNO_EXECUTE_PERMISSION -DSILENT -DALL_INTERIOR_POINTERS
# To build the parallel collector on Linux, add to the above:
# -DGC_LINUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC
+# Mercury-specific CFLAGS:
+CFLAGS= -I$(srcdir)/include \
+ -DSILENT -DDONT_DEFINE_READ -DNO_DEBUGGING -DNO_EXECUTE_PERMISSION \
+ $(CFLAGS_FOR_PIC) $(DLL_CFLAGS) $(EXTRA_CFLAGS)
+# Note that the `mgnuc' script also passes -DNO_SIGNALS, unless
+# profiling was enabled (see comments in runtime/mercury_prof_mem.h for why).
+# We need $(CFLAGS_FOR_PIC) because we might be building a shared library.
+
# HOSTCC and HOSTCFLAGS are used to build executables that will be run as
# part of the build process, i.e. on the build machine. These will usually
# be the same as CC and CFLAGS, except in a cross-compilation environment.
@@ -298,7 +339,7 @@
$(srcdir)/include/private/gc_hdrs.h $(srcdir)/include/private/gc_locks.h \
$(srcdir)/include/gc.h \
$(srcdir)/include/private/gcconfig.h $(srcdir)/include/gc_typed.h \
- Makefile
+ $(LIBGC_DLL_H) Makefile
# The dependency on Makefile is needed. Changing
# options such as -DSILENT affects the size of GC_arrays,
# invalidating all .o files that rely on gc_priv.h
@@ -318,6 +359,12 @@
tests:
mkdir tests
+# Mercury-specific target:
+lib$(GC_GRADE)$(DLL_DEF_LIB).a: gc.a
+ rm -f lib$(GC_GRADE)$(DLL_DEF_LIB).a
+ # `ln -s' here doesn't work with gnu-win32, so we use `cp' instead
+ cp gc.a lib$(GC_GRADE)$(DLL_DEF_LIB).a
+
base_lib gc.a: $(OBJS) dyn_load.o $(UTILS)
echo > base_lib
rm -f dont_ar_1
@@ -367,6 +414,20 @@
dyn_load_sunos53.o: dyn_load.c
$(CC) $(CFLAGS) -DSUNOS53_SHARED_LIB -c $(srcdir)/dyn_load.c -o $@
+# Mercury-specific target:
+# generic shared library version of the collector
+lib$(GC_GRADE).so: $(OBJS) $(UTILS) # dyn_load_sunos53.o
+ rm -f on_sparc_sunos5_so
+ ./if_mach SPARC SUNOS5 touch on_sparc_sunos5_so
+ ./if_mach SPARC SUNOS5 $(MAKE) dyn_load_sunos53.o
+ ./if_mach SPARC SUNOS5 \
+ $(LINK_SHARED_OBJ) -o lib$(GC_GRADE).so $(OBJS) dyn_load_sunos53.o \
+ -ldl `./threadlibs`
+ ./if_not_there on_sparc_sunos5_so $(MAKE) dyn_load.o
+ ./if_not_there on_sparc_sunos5_so \
+ $(LINK_SHARED_OBJ) -o lib$(GC_GRADE).so $(OBJS) dyn_load.o -lc
+
+
# SunOS5 shared library version of the collector
sunos5gc.so: $(OBJS) dyn_load_sunos53.o
$(CC) -G -o sunos5gc.so $(OBJS) dyn_load_sunos53.o -ldl
@@ -544,19 +605,6 @@
gctest_irix_dyn_link: tests/test.o libirixgc.so
$(CC) -L$(ABSDIR) -o gctest_irix_dyn_link tests/test.o -lirixgc
-# The following appear to be dead, especially since libgc_globals.h
-# is apparently lost.
-test_dll.o: tests/test.c libgc_globals.h
- $(CC) $(CFLAGS) -DGC_USE_DLL -c tests/test.c -o test_dll.o
-
-test_dll: test_dll.o libgc_dll.a libgc.dll
- $(CC) test_dll.o -L$(ABSDIR) -lgc_dll -o test_dll
-
-SYM_PREFIX-libgc=GC
-
-# Uncomment the following line to build a GNU win32 DLL
-# include Makefile.DLLs
-
reserved_namespace: $(SRCS)
for file in $(SRCS) tests/test.c tests/test_cpp.cc; do \
sed s/GC_/_GC_/g < $$file > tmp; \
@@ -568,3 +616,43 @@
sed s/_GC_/GC_/g < $$file > tmp; \
cp tmp $$file; \
done
+
+#-----------------------------------------------------------------------------#
+
+# The Mmakefile invokes `make $(EXT_FOR_SHARED_LIB)',
+# so we need targets `a', `so', and `dll'.
+
+.PHONY: a
+a: lib$(GC_GRADE).a
+
+.PHONY: so
+so: lib$(GC_GRADE).so
+
+#-----------------------------------------------------------------------------#
+# support for DLLs using gnu-win32
+#-----------------------------------------------------------------------------#
+ifeq ($(USE_DLLS),yes)
+
+LIBGC_DLL_H = libgc_dll.h
+LIBGC_GLOBALS_H = libgc_globals.h
+
+DLL_CFLAGS = -DUSE_DLLS -DGC_DEFINE_DLL
+
+.PHONY: dll
+dll: libgc.dll libgc.a libgc_dll.h libgc_globals.h
+ @echo Made DLL
+
+# GNU Make seems to need these extra dependencies as a hint
+lib$(GC_GRADE).dll: lib$(GC_GRADE)$(DLL_DEF_LIB) libgc.def
+
+test_dll.o: tests/test.c libgc_dll.h libgc_globals.h
+ $(CC) $(CFLAGS) -UGC_DEFINE_DLL -c tests/test.c -o test_dll.o
+
+test_dll: test_dll.o libgc.a libgc.dll
+ $(CC) test_dll.o -L$(ABSDIR) -lgc -o test_dll
+
+SYM_PREFIX-libgc=GC
+include ../Makefile.DLLs
+
+endif
+#-----------------------------------------------------------------------------#
cvs diff: tag gc is not in file Mmakefile
Index: NT_MAKEFILE
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/NT_MAKEFILE,v
retrieving revision 1.1.1.5
diff -u -d -u -r1.1.1.5 NT_MAKEFILE
--- NT_MAKEFILE 2001/04/10 01:00:59 1.1.1.5
+++ NT_MAKEFILE 2001/04/10 03:33:41
@@ -1,32 +1,69 @@
+#-----------------------------------------------------------------------------#
+# Copyright (C) 2000 The University of Melbourne.
+# This file may only be copied under the terms of the GNU General
+# Public Licence - see the file COPYING in the Mercury distribution.
+#-----------------------------------------------------------------------------#
# Makefile for Windows NT. Assumes Microsoft compiler, and a single thread.
# DLLs are included in the root set under NT, but not under win32S.
# Use "nmake nodebug=1 all" for optimized versions of library, gctest and editor.
+# ddw Tue Dec 01 13:58:12 1998
+# Modified to include stuff fjh had put in Unix Makefile
+#-------------------------------------------------------
+MERCURY_DIR=..
+include ../Mmake.common
+CC=../scripts/mgnuc --grade $(GRADE) --no-ansi --no-check
+cc=$(CC)
+cdebug=
+LINK=link
+link=$(LINK)
CPU= i386
-!include <ntwin32.mak>
+#!include <ntwin32.mak>
OBJS= alloc.obj reclaim.obj allchblk.obj misc.obj mach_dep.obj os_dep.obj mark_rts.obj headers.obj mark.obj obj_map.obj blacklst.obj finalize.obj new_hblk.obj dbg_mlc.obj malloc.obj stubborn.obj dyn_load.obj typd_mlc.obj ptr_chck.obj gc_cpp.obj mallocx.obj
all: gctest.exe cord\de.exe test_cpp.exe
-.c.obj:
- $(cc) $(cdebug) $(cflags) $(cvars) -Iinclude -DSILENT -DALL_INTERIOR_POINTERS -D__STDC__ $*.c /Fo$*.obj
+libpar_gc.lib:
+ MAKEFLAGS="" nmake /F gc.mak
+ cp Release/libpar_gc.lib ./libpar_gc.lib
+ cp Release/libpar_gc.dll ./libpar_gc.dll
-.cpp.obj:
- $(cc) $(cdebug) $(cflags) $(cvars) -Iinclude -DSILENT -DALL_INTERIOR_POINTERS $*.CPP /Fo$*.obj
+dll: libgcd$(DLL_DEF_LIB).dll
+libgc$(DLL_DEF_LIB).dll: libgcd.dll
+
+%.obj:%.c
+ $(cc) $(cdebug) $(CFLAGS) $(cvars) -Iinclude -DSILENT -DALL_INTERIOR_POINTERS -D__STDC__ /c /Fo$*.obj $*.c
+%.obj:%.cpp
+ $(cc) $(cdebug) $(CFLAGS) $(cvars) -Iinclude -DSILENT -DALL_INTERIOR_POINTERS $*.CPP /c /Fo$*.obj
+
$(OBJS) tests\test.obj: include\private\gc_priv.h include\private\gc_hdrs.h include\gc.h include\private\gcconfig.h include\private\gc_locks.h include\private\gc_mark.h
gc.lib: $(OBJS)
lib /MACHINE:i386 /out:gc.lib $(OBJS)
+# a .def defining exports should be made....
+libgcd$(DLL_DEF_LIB).dll: $(OBJS)
+# $(link) /MACHINE:i386 /DLL /out:libgcd.dll $(OBJS)
+
# The original NT SDK used lib32 instead of lib
+libnogc$(DLL_DEF_LIB).lib: gc.lib
+ rm -f libnogc$(DLL_DEF_LIB).lib
+ # `ln -s' here doesn't work with gnu-win32, so we use `cp' instead
+ cp gc.lib libnogc$(DLL_DEF_LIB).lib
+
+libgc$(DLL_DEF_LIB).lib: gc.lib
+ rm -f libgc$(DLL_DEF_LIB).lib
+ # `ln -s' here doesn't work with gnu-win32, so we use `cp' instead
+ cp gc.lib libgc$(DLL_DEF_LIB).lib
+
gctest.exe: tests\test.obj gc.lib
# The following works for win32 debugging. For win32s debugging use debugtype:coff
# and add mapsympe line.
# This produces a "GUI" applications that opens no windows and writes to the log file
# "gc.log". This is done to make the result runnable under win32s.
- $(link) -debug:full -debugtype:cv $(guiflags) -stack:131072 -out:$*.exe tests\test.obj $(guilibs) gc.lib
+ $(link) -debug:full -debugtype:cv $(guiflags) -stack:131072 -out:gctest.exe tests\test.obj $(guilibs) libgc.lib
# mapsympe -n -o gctest.sym gctest.exe
cord\de_win.rbj: cord\de_win.res
@@ -38,22 +75,40 @@
$(rc) $(rcvars) -r -fo cord\de_win.res $(cvars) cord\de_win.rc
# Cord/de is a real win32 gui application.
-cord\de.exe: cord\cordbscs.obj cord\cordxtra.obj cord\de.obj cord\de_win.obj cord\de_win.rbj gc.lib
- $(link) -debug:full -debugtype:cv $(guiflags) -stack:16384 -out:cord\de.exe cord\cordbscs.obj cord\cordxtra.obj cord\de.obj cord\de_win.obj cord\de_win.rbj gc.lib $(guilibs)
+cord\de.exe: cord\cordbscs.obj cord\cordxtra.obj cord\de.obj cord\de_win.obj cord\de_win.rbj libgc.lib
+ $(link) -debug:full -debugtype:cv $(guiflags) -stack:16384 -out:cord\de.exe cord\cordbscs.obj cord\cordxtra.obj cord\de.obj cord\de_win.obj cord\de_win.rbj libgc.lib $(guilibs)
gc_cpp.obj: include\gc_cpp.h include\gc.h
gc_cpp.cpp: gc_cpp.cc
- copy gc_cpp.cc gc_cpp.cpp
+ cp gc_cpp.cc gc_cpp.cpp
test_cpp.cpp: tests\test_cpp.cc
- copy tests\test_cpp.cc test_cpp.cpp
+ cp tests\test_cpp.cc test_cpp.cpp
# This generates the C++ test executable. The executable expects
# a single numeric argument, which is the number of iterations.
# The output appears in the file "gc.log".
test_cpp.exe: test_cpp.obj include\gc_cpp.h include\gc.h gc.lib
- $(link) -debug:full -debugtype:cv $(guiflags) -stack:16384 -out:test_cpp.exe test_cpp.obj gc.lib $(guilibs)
+ $(link) -debug:full -debugtype:cv $(guiflags) -stack:16384 -out:test_cpp.exe test_cpp.obj libgc.lib $(guilibs)
+
+
+.PHONY: clean
+clean:
+ -rm -f *.lib *.dll *.obj
+ -rm -rf Release
+# The Mmakefile invokes `make $(EXT_FOR_SHARED_LIB)',
+# so we need targets `a', `so', and `dll'.
+.PHONY: lib
+lib: lib$(GC_GRADE).lib
+
+.PHONY: so
+so:
+ echo "Unable to build DLL yet!"
+
+.PHONY: dll
+dll:
+ echo "Unable to build DLL yet!"
Index: allchblk.c
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/allchblk.c,v
retrieving revision 1.1.1.11
diff -u -d -u -r1.1.1.11 allchblk.c
--- allchblk.c 2001/04/10 01:00:39 1.1.1.11
+++ allchblk.c 2001/04/10 03:35:45
@@ -13,6 +13,7 @@
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*/
+/* I commented out the warning about allocating blacklisted blocks - fjh. */
/* #define DEBUG */
#include <stdio.h>
@@ -654,10 +655,12 @@
&& orig_avail - size_needed
> (signed_word)BL_LIMIT) {
/* Punt, since anything else risks unreasonable heap growth. */
+#ifdef WARN_BLACK_LIST
if (0 != GETENV("GC_NO_BLACKLIST_WARNING")) {
WARN("Needed to allocate blacklisted block at 0x%lx\n",
(word)hbp);
}
+#endif
size_avail = orig_avail;
} else if (size_avail == 0 && size_needed == HBLKSIZE
&& IS_MAPPED(hhdr)) {
Index: dyn_load.c
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/dyn_load.c,v
retrieving revision 1.1.1.11
diff -u -d -u -r1.1.1.11 dyn_load.c
--- dyn_load.c 2001/04/10 01:00:48 1.1.1.11
+++ dyn_load.c 2001/04/10 03:43:07
@@ -52,7 +52,7 @@
!defined(MSWIN32) && !defined(MSWINCE) && \
!(defined(ALPHA) && defined(OSF1)) && \
!defined(HPUX) && !(defined(LINUX) && defined(__ELF__)) && \
- !defined(RS6000) && !defined(SCO_ELF) && \
+ !defined(RS6000) && !defined(SCO_ELF) && !defined(FREEBSD) && \
!(defined(NETBSD) && defined(__ELF__))
--> We only know how to find data segments of dynamic libraries for the
--> above. Additional SVR4 variants might not be too
@@ -243,7 +243,7 @@
# endif /* SUNOS */
#if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
- (defined(NETBSD) && defined(__ELF__))
+ (defined(NETBSD) && defined(__ELF__)) || defined(FREEBSD)
#ifdef USE_PROC_FOR_LIBRARIES
Index: gc.h
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/gc.h,v
retrieving revision 1.1.1.10
retrieving revision 1.29
diff -u -d -u -r1.1.1.10 -r1.29
--- gc.h 2000/09/18 09:40:22 1.1.1.10
+++ gc.h 2000/10/04 04:51:02 1.29
@@ -1,3 +1,4 @@
+/* I have modified this file slightly to avoid some compiler warnings - fjh. */
/*
* Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
* Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved.
@@ -25,6 +26,10 @@
* Everything else is best ignored unless you encounter performance
* problems.
*/
+
+/*
+ * I added support for Windows DLLs using gnu-win32. -fjh.
+ */
#ifndef _GC_H
@@ -32,8 +37,8 @@
# define __GC
# include <stddef.h>
-#if defined(__CYGWIN32__) && defined(GC_USE_DLL)
-#include "libgc_globals.h"
+#if defined(USE_DLLS)
+#include "libgc_dll.h"
#endif
#if defined(__MINGW32__) && defined(WIN32_THREADS)
@@ -703,7 +708,12 @@
/* Note also that the collector cannot see thread specific data. */
/* Thread specific data should generally consist of pointers to */
/* uncollectable objects, which are deallocated using the destructor */
-/* facility in thr_keycreate. */
+/* facility in thr_keycreate. But unless your uncollectable objects */
+/* are also atomic, you must take care to ensure that the thread */
+/* specific data is also stored on the thread stack, so that the */
+/* collector doesn't try to reclaim collectable objects pointed to */
+/* only by uncollectable objects which are reachable only from */
+/* thread-local storage. */
# include <thread.h>
# include <signal.h>
int GC_thr_create(void *stack_base, size_t stack_size,
@@ -766,8 +776,7 @@
GC_PTR GC_malloc_many(size_t lb);
#define GC_NEXT(p) (*(GC_PTR *)(p)) /* Retrieve the next element */
/* in returned list. */
-extern void GC_thr_init(); /* Needed for Solaris/X86 */
-
+extern void GC_thr_init(void); /* Needed for Solaris/X86 */
#endif /* THREADS && !SRC_M3 */
/*
@@ -777,14 +786,22 @@
* This circumvents a Solaris 2.X (X<=4) linker bug.
*/
#if defined(sparc) || defined(__sparc)
-# define GC_INIT() { extern end, etext; \
+# define GC_INIT() { extern int end, etext; \
+ extern void GC_noop(void *, void *); \
GC_noop(&end, &etext); }
#else
-# if defined(__CYGWIN32__) && defined(GC_USE_DLL)
+# if defined(__CYGWIN32__)
/*
- * Similarly gnu-win32 DLLs need explicit initialization
+ * Similarly gnu-win32 DLLs need explicit initialization.
+ * (We can't use DATASTART and DATAEND here, because gc_private.h
+ * may not have been included.)
+ * XXX The use of _bss_start__ and _data_end__ below is WRONG!
+ * It does not match the code in config.h.
*/
-# define GC_INIT() { GC_add_roots(DATASTART, DATAEND); }
+# define GC_INIT() { \
+ extern int _bss_start__, _data_end__; \
+ GC_add_roots((void *)&_bss_start__, (void *)&_data_end__); \
+ }
# else
# define GC_INIT()
# endif
@@ -794,7 +811,7 @@
|| defined(_WIN32)
/* win32S may not free all resources on process exit. */
/* This explicitly deallocates the heap. */
- GC_API void GC_win32_free_heap ();
+ GC_API void GC_win32_free_heap GC_PROTO((void));
#endif
#ifdef __cplusplus
Index: gc.mak
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/gc.mak,v
retrieving revision 1.1.1.3
diff -u -d -u -r1.1.1.3 gc.mak
--- gc.mak 2001/04/10 01:01:02 1.1.1.3
+++ gc.mak 2001/04/10 02:58:37
@@ -55,7 +55,7 @@
OUTDIR=.\Release
INTDIR=.\Release
-ALL : ".\Release\gc.dll" ".\Release\gc.bsc"
+ALL : ".\Release\libpar_gc.dll" ".\Release\libpar_gc.bsc"
CLEAN :
- at erase ".\Release\allchblk.obj"
@@ -72,10 +72,10 @@
- at erase ".\Release\dyn_load.sbr"
- at erase ".\Release\finalize.obj"
- at erase ".\Release\finalize.sbr"
- - at erase ".\Release\gc.bsc"
- - at erase ".\Release\gc.dll"
- - at erase ".\Release\gc.exp"
- - at erase ".\Release\gc.lib"
+ - at erase ".\Release\libpar_gc.bsc"
+ - at erase ".\Release\libpar_gc.dll"
+ - at erase ".\Release\libpar_gc.exp"
+ - at erase ".\Release\libpar_gc.lib"
- at erase ".\Release\headers.obj"
- at erase ".\Release\headers.sbr"
- at erase ".\Release\mach_dep.obj"
@@ -172,7 +172,7 @@
".\Release\typd_mlc.sbr" \
".\Release\win32_threads.sbr"
-".\Release\gc.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+".\Release\libpar_gc.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
$(BSC32) @<<
$(BSC32_FLAGS) $(BSC32_SBRS)
<<
@@ -183,8 +183,8 @@
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
odbccp32.lib /nologo /subsystem:windows /dll /incremental:no\
- /pdb:"$(OUTDIR)/gc.pdb" /machine:I386 /out:"$(OUTDIR)/gc.dll"\
- /implib:"$(OUTDIR)/gc.lib"
+ /pdb:"$(OUTDIR)/libpar_gc.pdb" /machine:I386 /out:"$(OUTDIR)/libpar_gc.dll"\
+ /implib:"$(OUTDIR)/libpar_gc.lib"
LINK32_OBJS= \
".\Release\allchblk.obj" \
".\Release\alloc.obj" \
@@ -209,7 +209,7 @@
".\Release\typd_mlc.obj" \
".\Release\win32_threads.obj"
-".\Release\gc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+".\Release\libpar_gc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
@@ -229,7 +229,7 @@
OUTDIR=.\Debug
INTDIR=.\Debug
-ALL : ".\Debug\gc.dll" ".\Debug\gc.bsc"
+ALL : ".\Debug\libpar_gc.dll" ".\Debug\libpar_gc.bsc"
CLEAN :
- at erase ".\Debug\allchblk.obj"
@@ -246,12 +246,12 @@
- at erase ".\Debug\dyn_load.sbr"
- at erase ".\Debug\finalize.obj"
- at erase ".\Debug\finalize.sbr"
- - at erase ".\Debug\gc.bsc"
- - at erase ".\Debug\gc.dll"
- - at erase ".\Debug\gc.exp"
- - at erase ".\Debug\gc.lib"
- - at erase ".\Debug\gc.map"
- - at erase ".\Debug\gc.pdb"
+ - at erase ".\Debug\libpar_gc.bsc"
+ - at erase ".\Debug\libpar_gc.dll"
+ - at erase ".\Debug\libpar_gc.exp"
+ - at erase ".\Debug\libpar_gc.lib"
+ - at erase ".\Debug\libpar_gc.map"
+ - at erase ".\Debug\libpar_gc.pdb"
- at erase ".\Debug\headers.obj"
- at erase ".\Debug\headers.sbr"
- at erase ".\Debug\mach_dep.obj"
@@ -351,7 +351,7 @@
".\Debug\typd_mlc.sbr" \
".\Debug\win32_threads.sbr"
-".\Debug\gc.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+".\Debug\libpar_gc.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
$(BSC32) @<<
$(BSC32_FLAGS) $(BSC32_SBRS)
<<
@@ -362,8 +362,8 @@
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
odbccp32.lib /nologo /subsystem:windows /dll /incremental:no\
- /pdb:"$(OUTDIR)/gc.pdb" /map:"$(INTDIR)/gc.map" /debug /machine:I386\
- /out:"$(OUTDIR)/gc.dll" /implib:"$(OUTDIR)/gc.lib"
+ /pdb:"$(OUTDIR)/libpar_gc.pdb" /map:"$(INTDIR)/libpar_gc.map" /debug /machine:I386\
+ /out:"$(OUTDIR)/libpar_gc.dll" /implib:"$(OUTDIR)/libpar_gc.lib"
LINK32_OBJS= \
".\Debug\allchblk.obj" \
".\Debug\alloc.obj" \
@@ -388,7 +388,7 @@
".\Debug\typd_mlc.obj" \
".\Debug\win32_threads.obj"
-".\Debug\gc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+".\Debug\libpar_gc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
@@ -469,7 +469,7 @@
/pdb:"$(OUTDIR)/gctest.pdb" /machine:I386 /out:"Release/gctest.exe"
LINK32_OBJS= \
".\gctest\Release\test.obj" \
- ".\Release\gc.lib"
+ ".\Release\libpar_gc.lib"
".\Release\gctest.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
@@ -561,7 +561,7 @@
/pdb:"$(OUTDIR)/gctest.pdb" /map:"$(INTDIR)/gctest.map" /debug /machine:I386\
/out:"Debug/gctest.exe"
LINK32_OBJS= \
- ".\Debug\gc.lib" \
+ ".\Debug\libpar_gc.lib" \
".\gctest\Debug\test.obj"
".\Debug\gctest.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
@@ -650,7 +650,7 @@
".\cord\Release\de.obj" \
".\cord\Release\de_win.obj" \
".\cord\Release\de_win.res" \
- ".\Release\gc.lib"
+ ".\Release\libpar_gc.lib"
".\Release\de.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
@@ -743,7 +743,7 @@
".\cord\Debug\de.obj" \
".\cord\Debug\de_win.obj" \
".\cord\Debug\de_win.res" \
- ".\Debug\gc.lib"
+ ".\Debug\libpar_gc.lib"
".\Debug\de.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
Index: gc_cpp.cc
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/gc_cpp.cc,v
retrieving revision 1.1.1.2
retrieving revision 1.3
diff -u -d -u -r1.1.1.2 -r1.3
--- gc_cpp.cc 1999/07/14 23:47:08 1.1.1.2
+++ gc_cpp.cc 2000/09/29 11:12:15 1.3
@@ -48,6 +48,7 @@
#endif
#ifdef OPERATOR_NEW_ARRAY
+# ifndef _MSC_VER
void* operator new[]( size_t size ) {
return GC_MALLOC_UNCOLLECTABLE( size );}
@@ -55,6 +56,7 @@
void operator delete[]( void* obj ) {
GC_FREE( obj );}
+# endif
#endif /* OPERATOR_NEW_ARRAY */
Index: gcconfig.h
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/gcconfig.h,v
retrieving revision 1.1.1.4
retrieving revision 1.6
diff -u -d -u -r1.1.1.4 -r1.6
--- gcconfig.h 2000/09/18 09:40:26 1.1.1.4
+++ gcconfig.h 2000/12/09 15:24:31 1.6
@@ -1314,7 +1314,8 @@
# endif
# if defined(HP_PA) || defined(M88K) || defined(POWERPC) \
- || (defined(I386) && defined(OS2)) || defined(UTS4) || defined(LINT)
+ || (defined(I386) && defined(OS2)) || defined(UTS4) \
+ || (defined(I386) && defined(__LCC__)) || defined(LINT)
/* Use setjmp based hack to mark from callee-save registers. */
# define USE_GENERIC_PUSH_REGS
# endif
cvs diff: hpux_irix_threads.c was removed, no comparison available
Index: if_mach.c
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/if_mach.c,v
retrieving revision 1.1.1.4
diff -u -d -u -r1.1.1.4 if_mach.c
--- if_mach.c 2001/04/10 01:00:55 1.1.1.4
+++ if_mach.c 2001/04/10 02:58:37
@@ -15,6 +15,7 @@
if (strcmp(OS_TYPE, "") != 0 && strcmp(argv[2], "") != 0
&& strcmp(OS_TYPE, argv[2]) != 0) return(0);
printf("^^^^Starting command^^^^\n");
+ fflush(stdout);
execvp(argv[3], argv+3);
perror("Couldn't execute");
Index: if_not_there.c
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/if_not_there.c,v
retrieving revision 1.1.1.5
diff -u -d -u -r1.1.1.5 if_not_there.c
--- if_not_there.c 2001/04/10 01:00:56 1.1.1.5
+++ if_not_there.c 2001/04/10 02:58:37
@@ -18,6 +18,7 @@
return(0);
}
printf("^^^^Starting command^^^^\n");
+ fflush(stdout);
execvp(argv[2], argv+2);
exit(1);
Index: misc.c
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/misc.c,v
retrieving revision 1.1.1.11
diff -u -d -u -r1.1.1.11 misc.c
--- misc.c 2001/04/10 01:00:39 1.1.1.11
+++ misc.c 2001/04/10 02:58:38
@@ -72,6 +72,8 @@
# endif
# endif
+/* #include "mercury_stacks.h" */
+
GC_FAR struct _GC_arrays GC_arrays /* = { 0 } */;
@@ -287,6 +289,7 @@
/* frequency decreases, thus clearing frequency would decrease, */
/* thus more junk remains accessible, thus the heap gets */
/* larger ... */
+ /* clear_mercury_stacks(); */
# ifdef THREADS
if (++random_no % 13 == 0) {
limit = sp;
Index: os_dep.c
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/os_dep.c,v
retrieving revision 1.1.1.12
diff -u -d -u -r1.1.1.12 os_dep.c
--- os_dep.c 2001/04/10 01:00:42 1.1.1.12
+++ os_dep.c 2001/04/10 03:50:54
@@ -13,6 +13,9 @@
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*/
+/* Boehm, March 8, 1996 12:00 pm PST */
+/* I added the `#ifndef DONT_DEFINE_READ',
+ and the work-around for SIG_FILL on gnu-win32. -fjh. */
# include "private/gc_priv.h"
@@ -338,7 +341,12 @@
void GC_disable_signals()
{
if (!mask_initialized) {
+#ifdef SIG_FILL
SIG_FILL(new_mask);
+#else
+ /* gnu-win32 is broken, it doesn't define SIG_FILL */
+ /* never mind, Mercury doesn't use this function anyway */
+#endif
SIG_DEL(new_mask, SIGSEGV);
SIG_DEL(new_mask, SIGILL);
@@ -2445,7 +2453,7 @@
((ptr_t)end_block - (ptr_t)start_block) + HBLKSIZE);
}
-#if !defined(MSWIN32) && !defined(MSWINCE) && !defined(LINUX_THREADS)
+#if !defined(MSWIN32) && !defined(MSWINCE) && !defined(LINUX_THREADS) && !defined(DONT_DEFINE_READ)
/* Replacement for UNIX system call. */
/* Other calls that write to the heap */
/* should be handled similarly. */
cvs diff: Diffing Mac_files
cvs diff: tag gc is not in file Mac_files/.nocopyright
cvs diff: Diffing cord
cvs diff: tag gc is not in file cord/.nocopyright
cvs diff: Diffing cord/private
cvs diff: tag gc is not in file cord/private/.nocopyright
cvs diff: Diffing doc
cvs diff: Diffing include
cvs diff: tag gc is not in file include/.nocopyright
Index: include/gc.h
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/include/gc.h,v
retrieving revision 1.1.1.11
diff -u -d -u -r1.1.1.11 gc.h
--- include/gc.h 2001/04/10 01:01:04 1.1.1.11
+++ include/gc.h 2001/04/10 04:08:04
@@ -1,3 +1,4 @@
+/* I have modified this file slightly to avoid some compiler warnings - fjh. */
/*
* Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
* Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved.
@@ -25,6 +26,10 @@
* Everything else is best ignored unless you encounter performance
* problems.
*/
+
+/*
+ * I added support for Windows DLLs using gnu-win32. -fjh.
+ */
#ifndef _GC_H
@@ -80,8 +85,8 @@
typedef long ptrdiff_t; /* ptrdiff_t is not defined */
# endif
-#if defined(__CYGWIN32__) && defined(GC_USE_DLL)
-#include "libgc_globals.h"
+#if defined(USE_DLLS)
+#include "libgc_dll.h"
#endif
#if defined(__MINGW32__) && defined(WIN32_THREADS)
@@ -812,8 +817,7 @@
GC_PTR GC_malloc_many(size_t lb);
#define GC_NEXT(p) (*(GC_PTR *)(p)) /* Retrieve the next element */
/* in returned list. */
-extern void GC_thr_init(); /* Needed for Solaris/X86 */
-
+extern void GC_thr_init(void); /* Needed for Solaris/X86 */
#endif /* THREADS && !SRC_M3 */
#if defined(WIN32_THREADS) && defined(_WIN32_WCE)
@@ -852,14 +856,22 @@
* This circumvents a Solaris 2.X (X<=4) linker bug.
*/
#if defined(sparc) || defined(__sparc)
-# define GC_INIT() { extern end, etext; \
+# define GC_INIT() { extern int end, etext; \
+ extern void GC_noop(void *, void *); \
GC_noop(&end, &etext); }
#else
-# if defined(__CYGWIN32__) && defined(GC_USE_DLL)
+# if defined(__CYGWIN32__)
/*
- * Similarly gnu-win32 DLLs need explicit initialization
+ * Similarly gnu-win32 DLLs need explicit initialization.
+ * (We can't use DATASTART and DATAEND here, because gc_private.h
+ * may not have been included.)
+ * XXX The use of _bss_start__ and _data_end__ below is WRONG!
+ * It does not match the code in config.h.
*/
-# define GC_INIT() { GC_add_roots(DATASTART, DATAEND); }
+# define GC_INIT() { \
+ extern int _bss_start__, _data_end__; \
+ GC_add_roots((void *)&_bss_start__, (void *)&_data_end__); \
+ }
# else
# define GC_INIT()
# endif
@@ -870,7 +882,7 @@
|| defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__CYGWIN__))
/* win32S may not free all resources on process exit. */
/* This explicitly deallocates the heap. */
- GC_API void GC_win32_free_heap ();
+ GC_API void GC_win32_free_heap GC_PROTO((void));
#endif
#if ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) )
cvs diff: tag gc is not in file include/private/.nocopyright
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list